This resource is created for Game Maker 5 and isn't compatible with the latest version of Game Maker.
My apologies for the inconvinience.
My apologies for the inconvinience.
Mouse scriptA 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); } |
Tip: Have a look at the tutorial How to execute a script
User comments
| No_SkillZ posted at 2005-04-01 01:03:33 | ![]() |
| JesseD.nl posted at 2007-05-20 18:12:00 | ![]() |
| Amir posted at 2007-10-07 01:10:24 | ![]() |
| Simon Donkers posted at 2007-10-10 17:47:24 | ![]() |
| gamemakerdude posted at 2008-06-22 20:28:40 | ![]() |



