Jump to content

inputUp on sprite when input started outside the sprite


Recommended Posts

Hello, I have a question. I need to capture onInputUp on a sprite. 


I use


When the input starts over the sprite, everything works. But if the input starts next to it and then the pointer moves over the sprite, the onInputUp event is not fired.
How can I get onInputUp over a sprite if the input started outside the sprite?
Link to comment
Share on other sites

You'll have to roll your own solution for that one, as Phaser only fires the onUp if the onDown was fired first, as you have experienced.


Yes, I ended up with:

game.input.onUp.add(onUp);function onUp(pointer) {  var sprite = pointer.targetObject;  ...}
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...