Hello!
Two quick questions about mouse pointers/cursors.
1) With a 640x400 game, when playing in full-screen, the mouse is ridiculously sensitive. How can I tone down the speed at which the mouse moves?
2) For some reason, when the mouse pointer changes to 'wait', it moves about 15-20 pixels. When it goes back to an active pointer, it moves back again. The sprites are exactly the same size. What's with that?
Thanks guys!
Try putting this in the repeatably execute always function near the top of the globalscrript.asc
Mouse.Update();
For 2): It might be that the 'cursor hotspot' for the pointer mode and wait mode are different, which would might (I haven't tested this) cause a jump.
1) Mouse.Update() will do nothing to fix the problem.
Try using the x2 filter for playing fullscreen, this will run the game @ 1280x800 and might fix the issue.
Quote from: Khris on Sat 02/02/2013 19:02:17
1) Mouse.Update() will do nothing to fix the problem.
Try using the x2 filter for playing fullscreen, this will run the game @ 1280x800 and might fix the issue.
Nope!
// Global script
float mouseSensitivity = 0.5; // Modify this value to change how sensitive the mouse is (1.0 = default sensitivity)
int prevMouse[2]; // Store the last known position of the cursor, so we can check if it has moved
function game_start(){
prevMouse[0] = mouse.x;
prevMouse[1] = mouse.y;
}
function repeatedly_execute_always(){
if(mouse.x != prevMouse[0] || mouse.y != prevMouse[1]){ // Mouse has moved from last stored location
// Work out the mouse movement delta, multiply it with our sensitivity modifier, and round it to an integer
int newPos[2];
newPos[0] = prevMouse[0] + FloatToInt(IntToFloat(mouse.x - prevMouse[0]) * mouseSensitivity, eRoundNearest);
newPos[1] = prevMouse[1] + FloatToInt(IntToFloat(mouse.y - prevMouse[1]) * mouseSensitivity, eRoundNearest);
Mouse.SetPosition(newPos[0], newPos[1]);
prevMouse[0] = mouse.x; // Update stored location
prevMouse[1] = mouse.y;
}
}
Not sure if this will look really weird though. It depends if AGS manages to draw the cursor momentarily before the script moves it. Hopefully not.
Naturally, provided this actually works, you can link that sensitivity variable to a slider in your game options!
"GlobalScript.asc(187): Error (line 187): Type mismatch: cannot convert 'int' to 'float'"
(Which corresponds to Line 13 above)
Whoops - sorry, I completely forgot to convert those floats to integers. I've corrected the script in my earlier post to round the updated positions to whole numbers.
Sadly, this doesn't work - or rather, it does indeed slow the mouse down, but it's trying to draw both positions as you move it, thus creating something that looks really jerky.
Quote from: geork on Sat 02/02/2013 17:36:35
For 2): It might be that the 'cursor hotspot' for the pointer mode and wait mode are different, which would might (I haven't tested this) cause a jump.
*slaps forehead*
Okay, I'm an idiot. Yes, this was why. So one problem solved. Thanks!
Quote from: Lewis on Sun 03/02/2013 09:45:15
Sadly, this doesn't work - or rather, it does indeed slow the mouse down, but it's trying to draw both positions as you move it, thus creating something that looks really jerky.
Ah, yes I thought that might happen. It's a shame there's no way to override/delay the default AGS cursor drawing routines.