Jump to content

Touch over? (sprite)


Recommended Posts

Hi all,

I've been looking for a way to reproduce 'mouseover' but with touch (like a 'touchover'). Basically what I wanted to do is to recognize whether the touch of the user, at some point, is over a sprite or not. It works fine with the mouse.

I'm pretty new at programming and I did look on whether it has already been asked but I couldn't find the same question.

Hope it's clear enough.


Thanks in advance for the help!

Link to comment
Share on other sites

Thanks both for the response.

nmiguelmoura, as for the touchstart and touchend, it works fine if the user just click and release but the problem start when the user click and hold. If he does and moves away from the sprite then I cannot track whether the sprite is being touched or not.

JazzAceman, I think I'll try your option.

Again thanks both!

Link to comment
Share on other sites

Sorry, for the delay. I've ruled out touchendoutside since, if I've understood correctly, the user needs to release the click to be activated.

Anyway I've managed getting the coordinates with the touchmove, combined with a hitTest function provided by one of the forum members. I'm sure it's not the most efective way, but it works. I've also thought of using "containsPoint" and "hitArea", but coudn't get it working.

So thanks all for the help!


Link to comment
Share on other sites

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.

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.


  • Recently Browsing   0 members

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