Jump to content

How to handle mouse move/touch move event in phaser.js?


xianjimli
 Share

Recommended Posts

Phaser handles inputs via the Pointer object, which has a position property. The current active pointer can always be determined by checking game.input.activePointer. You can also add a callback for whenever the active pointer moves by setting game.input.moveCallback to your callback, like so:

game.input.moveCallback = function(pointer, x, y) {  // pointer returns the active pointer, x and y return the position on the canvas}
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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