Jump to content

Inconsistent pointer callback behavior


Recommended Posts

Hey ya'll,


I'm trying to use mouse pointer lock to implement back and forth motion for a breakout-style game.


When using game.input.addMoveCallback to create the move callback, it only fires when I click, NOT when the pointer actually moves. Even when I have pointer lock, the resulting pointer object's movement attributes (movementX/Y, rawMovementX/Y, etc: ) are all 0, as though I didn't have pointer lock.


If I don't do that and try to use game.input.mouse.mouseMoveCallback, it works... sometimes. I've been trying for quite a while to figure out the circumstances that causes it to work or not work, but I can't for the life of me figure it out. The callback simply doesn't fire (when it does, everything works fine).


I can provide code, but there's nothing in its content that really makes a difference on the above issues. addMoveCallback really seems to function as an onDownCallback instead (and doesn't provide pointerLocked information), and mouseMoveCallback seems to completely arbitrarily work or not work.


I suspect for mouseMoveCallback the *onmousemove* event listener on the canvas is being removed and never added again.


I am using the latest build of MightyEditor, which I believe uses Phaser 2.2.3. Are any of these known issues for that build, and does this mean that I need to use Phaser 2.3.0 to get pointer locking/mousemove callbacks to function properly?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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