oliversb Posted June 22, 2014 Share Posted June 22, 2014 Is there an event in Phaser that occurs while the mouse is held instead of just at the start of a click? How can I apply this for a particular sprite and for anywhere on the game's stage? Thanks Link to comment Share on other sites More sharing options...
lewster32 Posted June 22, 2014 Share Posted June 22, 2014 A very similar question was only recently asked and answered: http://www.html5gamedevs.com/topic/7247-problem-with-onhold/ oliversb 1 Link to comment Share on other sites More sharing options...
oliversb Posted June 22, 2014 Author Share Posted June 22, 2014 cheers Link to comment Share on other sites More sharing options...
oliversb Posted June 22, 2014 Author Share Posted June 22, 2014 How would I apply this to a particular sprite? Thanks Link to comment Share on other sites More sharing options...
lewster32 Posted June 22, 2014 Share Posted June 22, 2014 Using sprite.input.checkPointerOver:function update() { if (game.input.activePointer.isDown && sprite.input.checkPointerOver(game.input.activePointer)) { // pointer is down and is over our sprite, so do something here }}Interestingly there's a checkPointerDown method too which would be easier still, but it seems to do exactly the same as the checkPointerOver method and doesn't seem to determine if the pointer is being pressed as it states it does. I've submitted a fix for this on Github. Link to comment Share on other sites More sharing options...
oliversb Posted June 23, 2014 Author Share Posted June 23, 2014 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts