shaneburk89 Posted January 15, 2015 Share Posted January 15, 2015 Has anyone had any experience with firing a function between touchstart and touchend when you "touchover" a sprite similar to how mouseover would work? Is there a way that I can get a sprite by location (can I write a function that will return a list of object that (200, 200) would touch)? If this is possible I feel I could write something for "touchover". Any tips to get started with this would help I'm at a loss and am running out of avenues to try. Quote Link to comment Share on other sites More sharing options...
JDW Posted January 15, 2015 Share Posted January 15, 2015 You want to use onTouchMove and on every call, get what sprite is under your finger, is that correct ? You can try to set a touchmove event on a display object container where you have your sprites, and then call the following method : /** * Tests if the current mouse coordinates hit a sprite * * @method hitTest * @param item {DisplayObject} The displayObject to test for a hit * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit * @private */ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) http://www.goodboydigital.com/pixijs/docs/files/src_pixi_InteractionManager.js.html#l586 I would recommend to not use hitTest at every touchmove call, as I fear the performances would be bad. Put some kind of limit. shaneburk89 1 Quote Link to comment Share on other sites More sharing options...
shaneburk89 Posted January 28, 2015 Author Share Posted January 28, 2015 Thank you! 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.