Jump to content

touchover event


shaneburk89
 Share

Recommended Posts

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. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...