How to do multitouch gestures: pinch/scale rotate? #9307
TimKraemer
started this conversation in
General
Replies: 1 comment
-
It looks like Pixi's touch events aren't really touch events. If the device supports "pointer" events, it takes precedence pixijs/packages/events/src/EventSystem.ts Lines 570 to 594 in c04c09c Normally, you can get a list of "touches" from events, but it looks like we'll have to implement that ourselves. In my usecase, I just want to P-Z the entire viewport, so the events would be global anyway, and I can just use the canvas element's events. For individual sprites, it would require a bit more work, it seems. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone!
I'm new to pixijs (actually using @pixi/react) and I'm curious what the appropriate way to use multi-touch gestures is for pixi.
I understand that this library is made for rendering 2D primarily, so I was thinking about using another library to handle touches and interpret gestures for me (e.g. https://github.com/pmndrs/use-gesture), but I noticed that it doesn't "just" work, most likely because of those libraries expect different event handlers like
onMouseDown
andonTouchStart
.But again, I'm very new at this, so I might be missing something obvious.... however I didn't find anything at all in the docs or here in github which is somewhat recent and related to multitouch gestures....
For now I work around the issue with one-finger dragging and pixi transformer. Obviously an ugly solution for mobile though :/
Any ideas/examples on what to combine to let me use the advantages of pixi and also the user-experience of multi-touch gestures? E.g. an example on how to drag/rotate/scale a sprite?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions