Posts: 360
Threads: 36
Joined: Mar 2023
Reputation:
28
Howdy. I'm using X axis mouse moves to control the rotation of a new, scrappy, little spaceship. All is great until I reach the end of the range of that command (the actual edges of the desktop not the screen image), then the ship either freezes up at one extreme or can rotate no further at the other end. The command's range is -50 to _DESKTOPWIDTH - 50. There's plenty of range for the game to work; it's just annoying that you have to stay within the parameters...
The question is, is there a way to overcome this and have unlimited X readings or do I need to warn the user to "unwind" the mouse position as they go and maybe provide an onscreen indicator as to where the mouse is within its range? Gracias, amigos.
Posts: 273
Threads: 2
Joined: Apr 2022
Reputation:
58
What platform are you using? I ask because on Windows I believe it should already work as you're describing, it should continue to report the relative movement regardless of the actual cursor position. On Linux and Mac OS the support is currently a bit more limited and it will get stuck like you're suggesting (which is something that will hopefully be fixed in the future).
To clarify, you're saying that `_MouseMovementX` starts returning 0 when the mouse hits the edge of the screen even if you're still moving the mouse in that direction?
Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
? Mousemovement has always been broken as far as I remember.
Why is _MouseX, _MouseY not good enough to work with? You've seen the lectures on polling the mouse? ie
While _MouseInput: Wend ' < update mouse status don't put anything inside this loop!!! unless you need Mousewheel
'THEN set mouse status variable unless you need mouse_wheel
mx = _mouseX : my = _MouseY: mb1 = _Mousebutton(1) 'left mouse button down
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 273
Threads: 2
Joined: Apr 2022
Reputation:
58
Are you running on Mac OS or Linux? It's not yet properly implemented on those platforms, so that would be why.
Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
Quote:I just tested it on Windows, it works correctly. Whether you actually want that behavior depends a lot on what you're doing though Big Grin
Yeah well it never worked well or right since I remember and I got use to never needing it.
It is quite possible it got fixed and I missed that day it was announced.
I too would love to know why @NakedApe can get only 5 revolutions, I wonder if we are hitting the limit of Integer Type?
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
02-13-2024, 08:19 PM
(This post was last modified: 02-13-2024, 08:24 PM by bplus.)
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever