Gamebot
Member
I had thought that window_set_cursor was like a global which changes whenever you tell it too. It does for the most part except it only seems to change with the last instance. I tried two, then three, and four instances with each only the last instance will run the window_set_cursor code.
Oddly enough though all other relevant code before and after the changes happen. See here where I "divided" my box into 9 sections called setsize (for changing sizes and dragging). Sorry if it doesn't come out clear this time.
The left section, with three instances shows that the over and drag code get executed by the black box border however only the last instance changes to the drag hand. The right two single boxes show that my setsize or area where the mouse hits is working but not the cursor code except again the last instance. Here's the main code im currently using:
scr_get_handle();
Also I did try changinging all steps and draw events just to see if it would make a difference. None. Any thoughts appreciated.
Oddly enough though all other relevant code before and after the changes happen. See here where I "divided" my box into 9 sections called setsize (for changing sizes and dragging). Sorry if it doesn't come out clear this time.
The left section, with three instances shows that the over and drag code get executed by the black box border however only the last instance changes to the drag hand. The right two single boxes show that my setsize or area where the mouse hits is working but not the cursor code except again the last instance. Here's the main code im currently using:
scr_get_handle();
Code:
var pix = 4;
// if we are over any instance of obj_box exit so we don't change size accidentally when mouse is over both.
if (obj_box.mouse_over = true)
{setsize = 0; window_set_cursor(cr_arrow);}
// Over top left corner. Movement Hor left and Vert up (-x , -y)
else if (point_in_rectangle(mouse_x, mouse_y, x - pix, y - pix, x + pix, y + pix))
{setsize = 1; window_set_cursor(cr_size_nwse);}
// Over top but not in corners. Movemnent Vert up only (x , -y)
else if (point_in_rectangle(mouse_x, mouse_y, x + pix, y - pix, x + wid - pix, y + pix))
{setsize = 2; window_set_cursor(cr_size_ns);}
// Top right corner. Movement Vert up and Hor right. (+x , -y)
else if (point_in_rectangle(mouse_x, mouse_y, x + wid - pix, y - pix, x + wid + pix, y + pix))
{setsize = 3; window_set_cursor(cr_size_nesw);}
// Left of box not in corners. Movement Hor left only. (-x , y)
else if (point_in_rectangle(mouse_x, mouse_y, x - pix, y + pix, x + pix, y + hei - pix))
{setsize = 4; window_set_cursor(cr_size_we);}
// Right of box not in corners. Movement Hor Right only. (+x , y)
else if (point_in_rectangle(mouse_x, mouse_y, x + wid - pix, y + pix, x + wid + pix, y + hei - pix))
{setsize = 5; window_set_cursor(cr_size_we);}
// Left bottom corner. Movement Hor left and vert down. (-x , +y)
else if (point_in_rectangle(mouse_x, mouse_y, x - pix, y + hei - pix, x + pix, y + hei + pix))
{setsize = 6; window_set_cursor(cr_size_nesw);}
// Bottom of box. Movement vert down only. (x , +y)
else if (point_in_rectangle(mouse_x, mouse_y, x + pix, y + hei - pix, x + wid - pix, y + hei + pix))
{setsize = 7; window_set_cursor(cr_size_ns);}
// Bottom right corner. Movement Hor right and vert down. (+x , +y)
else if (point_in_rectangle(mouse_x, mouse_y, x + wid - pix, y + hei - pix, x + wid + pix, y + hei + pix))
{setsize = 8; window_set_cursor(cr_size_nwse);}
else {setsize = 0; window_set_cursor(cr_arrow);}
Last edited: