|
Post by u9 on May 4, 2007 10:04:08 GMT -5
what is the difference between mouse.x and accumulating mouse.dx. Thy the following code. It appears that mouse.dx is not really the change in mouse.x from last call. It seems to be affected by the acceleration of the mouse and maybe other stuff. Moving slowly, mouse.dx and dy change more then mouse.x and y (yellow text) every call, but if i move the mouse quickly then mouse.dx and dy (red text) moves slower.
Is this a bug or a feature? Why don't the two texts move equally fast?
Call main
Sub main() graphics.initialize 800, 600 key.initialize mouse.initialize Dim x, y x = mouse.x y = mouse.y Dim font font = graphics.createFont( "system", 10 ) Dim bRunning bRunning = True Do While Not( key.pressed( 0 ) Or key.pressed( 1 ) ) mouse.update ' I subtract here due to small error in v1.7.1 x = x - mouse.dx y = y - mouse.dy graphics.clear graphics.settext "mouse.x and y", mouse.x - 20, mouse.y - 8, font, &h99ffff00 graphics.settext "mouse.Dx and Dy", x - 20, y - 8, font, &h99ff0066 graphics.display Loop mouse.terminate key.terminate graphics.terminate End Sub
|
|
|
Post by Guilect on May 6, 2007 20:37:52 GMT -5
Strange. Investigating.
|
|