Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding recognizers dynamically #1005

Open
OpherV opened this issue Jul 28, 2016 · 9 comments
Open

Adding recognizers dynamically #1005

OpherV opened this issue Jul 28, 2016 · 9 comments

Comments

@OpherV
Copy link

OpherV commented Jul 28, 2016

Hi, I'm the author of #991 (SVG path trace recognizer)

tl;dr I suggest an enhancement to allow recognizer plugins for Hammer.js

Originally, and like I wrote in the PR comment, Hammer architecture currently does not easily allow adding recognizers dynamically. It assumes all recognizers are pre-packed with the lib, which makes it harder to write external modules. This means that extra functionality that might be relevant to some but not all use cases will either be deemed too out of scope and thus not included with hammer, or get included and bloat up the core lib.

Use case: Other than the SVG path follow I've already implemented, I'm also working on implementing an arbitrary shape/stroke recognizer based on $1 unistroke recognizer. This is a very specific use case that relies on an external library, with a different license than that of Hammerjs. It would be cool if Hammer could support it via external plugins, but without having to include both the implementation and the library in the source code.

@OpherV
Copy link
Author

OpherV commented Oct 7, 2016

Here's the shape/stroke recognizer in action, in a test from my game:

ezgif-2275375959

Would love to implement this as a plugin

@arschmitz
Copy link
Contributor

This is functionality we decided to add directly to the library probably in V3

@OpherV
Copy link
Author

OpherV commented Oct 7, 2016

Neat! Based on my work, or a new implementation?

I'd be happy to contribute/maintain the code. I've learned a lot about the nuances of these types of gestures during my work on the game, which is a high budget production set to release in a few weeks... :)

@arschmitz
Copy link
Contributor

@OpherV V3 is a complete re-write so not sure how direct it would transfer but we would love your help!

@arschmitz
Copy link
Contributor

Also the ability to add and remove recognizers has always been planned and will be in v3 to allow custom builds.

@OpherV
Copy link
Author

OpherV commented Oct 7, 2016

Alrighty then - I'll stay tuned.
I'm super excited for the project to be released so I can show you and @runspired

@arschmitz
Copy link
Contributor

We do most of our planning and discussion on slack feel free to join us

@OpherV
Copy link
Author

OpherV commented Dec 5, 2016

@arschmitz @runspired Like I promised it's finally out!
It's an interactive video/html5 game for the Detroit Pistons
Hammer.js is used to drive the game mechanic on mobile, but here's a secret link that lets you see it on desktop as well:

http://pistons.com/1on1?forcetouch=true

pistons

Check it out :)

@stereokai
Copy link

@OpherV What an awesome game!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants