Vega workshop Posted September 16, 2016 Share Posted September 16, 2016 Hello I am using Haxe with pixi v4, previously v3 (3.1.2). We can catch a pixi.interaction.EventTarget from a registered touch event listener. In the previous version, we could identify the touch thanks to the EventTarget::data.identifier property (member of InteractionData). The identifier property doesn't exist anymore with v4, does it ? Is there an alternative mechanism to distinguish a touch event from another ? (ie player 1, player 2, ...) I believe I could handle the problem, managing a collection of registered "touchdown" event. If a "touchmove" occures, I can associate it to the nearest registered position. If a "touchup" occures, I can remove the nearest registered position (this is theoric, I now there would be some cases to solve, ie a position disappears without a "touchup") But, no need to code this if there is a technic, a pattern to use to manage multitouch ... any idea ? thx Quote Link to comment Share on other sites More sharing options...
xerver Posted September 16, 2016 Share Posted September 16, 2016 You can access the originalEvent of the interaction and get the pointer/touch identifier from that. Vega workshop 1 Quote Link to comment Share on other sites More sharing options...
Vega workshop Posted September 16, 2016 Author Share Posted September 16, 2016 Thanks for reply. You mean the reference given by the "originalEvent" property can serve as an identifier ? Quote Link to comment Share on other sites More sharing options...
xerver Posted September 16, 2016 Share Posted September 16, 2016 Oh I see, we aren't telling you which touch caused the interaction, so you don't know which touch is operating. I would open an issue for this on the github so we can track it. Vega workshop 1 Quote Link to comment Share on other sites More sharing options...
Vega workshop Posted September 19, 2016 Author Share Posted September 19, 2016 Nice to track this one For the moment, I associate a "touchmove" event to the nearest previous "touchdown" I registered. Most of the time, it seems to work fine but there is some issues when the different touches get too close to each other. There's also another issue with iOS, when you get to close to the edge of the screen, which triggers an iOS popup that messes the touch events. In v3, thanks to the "identifier" property I could detect the issue because the "identifier" changed. In v4, without "identifier", I use a timeout which clears a registered touch if no input is detected. It works ... I know I should be looking for some kind of "deactivate" event, another story ... Thanks for the work on pixi ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.