Master Cabalist
Member
I'm trying to make a a button (a disc) that when you click on it it takes you to anoter room. I'm using point in rectangle to detect mouse enter and mouse event and check_mouse_pressed to detect the button click. It doesn' tdo anything though when I click on it. I did some debugging and its showing that the point in rectangle function isn't returning true at all, even in bounds.
Code:
if (point_in_rectangle(mouse_x, mouse_y,2300, 300, 2550, 400))
{
show_debug_message("CUrsor is in SaveLoad icon");
if (mouse_check_button_pressed(mb_left))
{
show_debug_message("Clicked SaveLoad button");
global.RoomBeforeSaveLoad = room;
room_set_persistent(FirstLevel, true);
room_goto(SaveExitRoom);
draw_set_colour(c_black);
}
}