Unexpected behavior with MouseXSpeed and MouseYSpe
BlitzMax Forums/BlitzMax Programming/Unexpected behavior with MouseXSpeed and MouseYSpe
| ||
When you first press the mouse button, the program checks the absolute location of the mouse pointer. Every subsequent check should return the relative position from the last check. If you run the program above, you will notice that the first line goes from the mouse pointer to some random point, then works as expected from there. Found out that MouseXSpeed() only checks the relative movement from the last MouseXSpeed(), but not from MouseX() so the very first time that MouseXSpeed() is called, it returns some unknown value. If you put MouseXSpeed() MouseYSpeed() on line 35, after the checks to MouseX() and MouseY() then the position is set to the current mouse position so the next calls are correct. |
| ||
it seem to be accumulative. Last edited 2011 Last edited 2011 |