Can I ask for the action for mouse plugin as "set cursor position" "set cursor position to another object" ?
+1 This would be good for restricting mouse to move to another monitor on fullscreen when using multiple monitor setup. Also I think people using something like Q3D plugin would like this if it doesn't have it's own function.
This is something that bother me also. When a Sprite's movement is based upon the mouse position, when the layout begins the Sprite begins to move without the user doing anything, just because the default mouse position is where ever the mouse is on the desktop at the time of the game's initialization.
Ideally, the mouse object should be inert until the user does something or the game tells it to do something, and the initial position should be fixed (if so desired).
Check the attached capx to see what I mean. Is there a workaround that?
Develop games in your browser. Powerful, performant & highly capable.
Setting the mouses position is prohibited in js.
http://stackoverflow.com/questions/4752 ... c-position
Otherwise the only other solution is mouse lock but that only works in Chrome or Firefox.
http://stackoverflow.com/questions/2601 ... -the-mouse
One solution for your example is to only move the box if mouse.x is nonzero.
Dear R0J0hound, thank you for your input. It's unfortunate that this is inherently to Js.
I'll try to work something around your suggestion!