Jump to content

sprite input does not end?


jmp909
 Share

Recommended Posts

Hi, 

 

I have an issue here...

 

http://phaser.io/sandbox/IbmnIilH/play

 

if you click (not hold) the Phaser sprite, and then move the cursor away from it, the debug says it is still "over", and the cursor is still a hand until you click on the stage somewhere

 

any ideas.. is this a bug, or am i doing something wrong?

 

[update: this line causes it but shouldn't really be affecting it: this.game.input.mouse.onMouseMove = onMouseMove]

 

(what I'm actually trying to achieve is only move the sprite around the circle when the cursor is over it *and* the mouse is down. Drag doesn't help because you can move the cursor away from the sprite and it still counts as dragging it as per this example http://phaser.io/sandbox/hftdIYxX/play)

 

thanks

j

Link to comment
Share on other sites

Change 

this.game.input.mouse.onMouseMove = onMouseMove;

For

this.game.input.mouse.mouseMoveCallback = onMouseMove;

Worth noticing, mouseMoveCallback does not appear in the doc (and it's not a property of the Mouse class).

 

Doc : http://phaser.io/docs/2.4.4/Phaser.Mouse.html#members

Relevant code : https://github.com/photonstorm/phaser/blob/v2.4.4/src/input/Mouse.js#L321

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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