pizzapizza Posted March 13, 2018 Share Posted March 13, 2018 I am using events.onInputUp.add on my Phaser.Sprite, but it is not working the way I need it to for my game. If I press down on my sprite and then release, it works, but if I press down anyplace else on the screen, rollover my sprite, and then release, the inputUp event never happens even though I am over my sprite and releasing. I need the up event to fire regardless of where the initial down event occurred. Any ideas? Link to comment Share on other sites More sharing options...
samme Posted March 13, 2018 Share Posted March 13, 2018 I think you'll have to listen to game.input.onUp sprite.events.onInputOver and then coordinate the two somehow. pizzapizza 1 Link to comment Share on other sites More sharing options...
pizzapizza Posted March 15, 2018 Author Share Posted March 15, 2018 On 3/13/2018 at 5:17 PM, samme said: I think you'll have to listen to game.input.onUp sprite.events.onInputOver and then coordinate the two somehow. That worked! I listened for the over/out events on the sprite to keep an "isOver" variable, and then doing this on the sprite game.input.onUp.add(function(){if(this.isOver){functionToRunOnMouseUp();}}); Thanks for the clue sending me in the right direction! Link to comment Share on other sites More sharing options...
Recommended Posts