Jump to content

inputUp on sprite when input started outside the sprite


Svet
 Share

Recommended Posts

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

 

I use

 

castle.events.onInputUp.add(handler,this);
 
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

 Share

  • Recently Browsing   0 members

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