Svet Posted March 8, 2014 Share Posted March 8, 2014 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 More sharing options...
Heppell08 Posted March 9, 2014 Share Posted March 9, 2014 Have you tried having:castle.input.enabled = true; Link to comment Share on other sites More sharing options...
XekeDeath Posted March 9, 2014 Share Posted March 9, 2014 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. Link to comment Share on other sites More sharing options...
Svet Posted March 9, 2014 Author Share Posted March 9, 2014 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 More sharing options...
Recommended Posts