Jump to content

Mouse hold event


Recommended Posts

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


  • Recently Browsing   0 members

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