Phaser 3 : detecting direction of mouse pointer travel on x axis

Hello,

Would anyone know how I can determine if the mouse cursor is moving left or right on the screen ?

I am actually associating a drag movement with a rotation. If the game object is dragged towards the right, I want the object to rotate clockwise while if the object is dragged to the left, I want it to rotate counterclockwise.

Thanks !

Something like sprite.input.dragX - sprite.input.dragStartX might do it.

Thanks for the suggestion. I tried that, but if I drag right by 100, and then back left by 20, the dragging back by 20 is not seen as going left because the difference compared to dragStart is still positive (x+80).

There is Pointer#velocity for the current movement.

That did the trick ! Thank you very much.