Sign in to follow this  
xianjimli

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

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}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.