to use the sky.getMouseDelta() and the new screen.getMouseDelta() is as follows:
- Code: Select all
msDeltaX, msDeltaY = sky.getMouseDelta();
a quicker way of using this is:
- Code: Select all
msDelta = newType.vec2(sky.getMouseDelta());
you can then use msDelta.x and msDelta.y in the code which returns an integer of the movement value.
eg. 1, 50, 100.
You can then divide the value by however much to get a usable delta. e.g.
- Code: Select all
msDelta.x = msDelta.x * 0.01;
msDelta.y = msDelta.y * 0.01;
User Request: Reset delta to 0, when mouse is not used.You will be happy to also know that we have fixed the mousedelta to return a 0 value if mouse if not moved,
when used in the update loop or anywhere outside of the onMouseMove(x,y) event.
The reason we did not have this, is due to the way we accessed the variable, which was through the onMouseMove event, not the update.
We handled all the movement from that event instead of the update to save unnecessary calls to commands when the mouse is not moved,
which ultimately saves performance.
But as with skyline, we want a system where it does what you want, and now it does
This will be in the next update.