Mouse script
A script with sets the mouse to the correct place on the screen. Even on the border of two views.
Mouse script |
//////////////// Mouse script ////////////////////
// // Copyright Simon Donkers 27-1-2005 // www.simondonkers.com - gmmentor@simondonkers.com // // // ///////////////////////////////////////////////////// x := mouse_x; y := mouse_y; the_x := 0; the_y := 0; if view_enabled then { for(i = 0; i<= 8; i += 1) { if view_visible[i] then { if mouse_x>= view_left[i] and mouse_x<= view_left[i] + view_width[i] and mouse_y>= view_top[i] and mouse_y<= view_top[i] + view_height[i] then { the_x := mouse_x-view_left[i] + view_x[i]; the_y := mouse_y-view_top[i] + view_y[i]; } } } if the_x = 0 and the_y = 0 then {exit;} for(i = 0; i<= 8; i += 1) { if view_visible[i] then { if view_x[i]-sprite_xoffset-sprite_width<= the_x and view_x[i]-sprite_xoffset + sprite_width + view_width[i]>= the_x and view_y[i]-sprite_yoffset-sprite_height<= the_y and view_y[i]-sprite_yoffset + view_height[i]>= the_y then { if view_current= i then { draw_sprite(sprite_index,-1,view_left[i] + the_x-view_x[i],view_top[i] + the_y-view_y[i]); } } } } } else { draw_sprite(sprite_index,-1,mouse_x,mouse_y); } |