Posted By: robertbruce
Limiting cursor speed - 09/20/11 20:39
Hello,
Is there a way to restrict the max speed of moving a cursor across the screen? My mouse code is below. Would appreciate any help.
function init_mouse()
{
mouse_map = arrow_bmp;
mouse_mode = 1;
mouse_spot.x = bmap_width(arrow_bmp)/2; // hot spot in the bmap center
mouse_spot.y = bmap_height(arrow_bmp)/2;
var mouse_limit_x;
var mouse_limit_y;
mouse_limit_x = (screen_size.x - bmap_width(arrow_bmp));
mouse_limit_y = (screen_size.y - bmap_width(arrow_bmp));
while (1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait(1);
}
}
thanks,
Rob
Is there a way to restrict the max speed of moving a cursor across the screen? My mouse code is below. Would appreciate any help.
function init_mouse()
{
mouse_map = arrow_bmp;
mouse_mode = 1;
mouse_spot.x = bmap_width(arrow_bmp)/2; // hot spot in the bmap center
mouse_spot.y = bmap_height(arrow_bmp)/2;
var mouse_limit_x;
var mouse_limit_y;
mouse_limit_x = (screen_size.x - bmap_width(arrow_bmp));
mouse_limit_y = (screen_size.y - bmap_width(arrow_bmp));
while (1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait(1);
}
}
thanks,
Rob