thammin/pixi-hammer

interactionManager usage

mralbobo opened this issue · 4 comments

Hey, I'm just kind of curious why you opted to roll your own hit test and and event handling system instead of just leeching off the pixi interaction manager. It's hitTest, mapPositionToPoint, and dispatchEvent.

Did a fork where I played with that if you're curious https://github.com/mralbobo/pixi-hammer

These codes were created about 2 years ago and the API was over opinionated for my old personal project.

  • Able to control the hitTest priority instead of base on scene graph's order. I have a lot of displayObjects and wanted to have a quick hitTest among few of them.
  • Able to create listeners easily and reuse same recognizer internally.

Btw, your fork look nice and is more general way to connect PIXI with Hammer.js.
I think its time to remove all the opinionated codes. Thanks for your ideas.

Could merge my stuff in wholesale if you so desired, is somewhat battle tested (using in my project).
Happy to jump on as a maintainer if you do.
I think my only particularly opinionated code is that with multi event... events (panStart, pan, panEnd, etc), I like to only hittest on the start event. Could always throw that behind a config flag.

If you're not interested in that, I'll probably do a name change and deploy mine to npm. Mainly just so that my project builds are more stable. The github package support is... spotty.

Created a pull request so you can just click a button if you want to roll with my implementation. Can probably just consider it to be a full rewrite.