A
Accredited Design
Guest
Hello everyone, this is my first post only because this one really has my brain giving off smoke.
So, the current structure I have is an intro room where you press a key to move on. This goes to the next room which is a just text scroller which gives a story. When it's done it goes to the first actual game room. The first two intro rooms are set to 1280x720. The 3rd room (actual game) is 10,000x10,000 using a 1280x720 view[0] centered on the player object. The game rooms are persistent, as well as the player object. This goes for the next room/level after it, and all future subsequent levels/rooms which I'll probably increase in total room size eventually.
The trouble I have is that I have a menu accessible via "ESC" key at any time. It is an object "obj_menu_controller" plopped into each room which merely watches for the ESC key and if pressed creates the menu object "obj_main_menu". It works perfectly both windowed and fullscreen in the first two 1280x720 rooms. When entering the 3rd room at 10,000x10,000 the menu still pauses the game and appears, but the mouse hovers break, rendering the menu useless. I assume it's because it's looking for mouse hover who knows where in the whole of the 10,000x10,000 room, but perhaps that's not the issue?? Here's my setup for the obj_main_menu:
CREATE EVENT:
DRAW GUI EVENT:
DESTROY EVENT:
PRESS ESCAPE EVENT:
Here's a screenie of the menu working in the first 2 rooms:
And a screenie of the "broken" menu in the 3rd and on rooms:
Any ideas on what could cause the mouse hover/sprite change to not work in the 3rd (huge) room? Thanks very much in advance for any guidance you may have to offer.
So, the current structure I have is an intro room where you press a key to move on. This goes to the next room which is a just text scroller which gives a story. When it's done it goes to the first actual game room. The first two intro rooms are set to 1280x720. The 3rd room (actual game) is 10,000x10,000 using a 1280x720 view[0] centered on the player object. The game rooms are persistent, as well as the player object. This goes for the next room/level after it, and all future subsequent levels/rooms which I'll probably increase in total room size eventually.
The trouble I have is that I have a menu accessible via "ESC" key at any time. It is an object "obj_menu_controller" plopped into each room which merely watches for the ESC key and if pressed creates the menu object "obj_main_menu". It works perfectly both windowed and fullscreen in the first two 1280x720 rooms. When entering the 3rd room at 10,000x10,000 the menu still pauses the game and appears, but the mouse hovers break, rendering the menu useless. I assume it's because it's looking for mouse hover who knows where in the whole of the 10,000x10,000 room, but perhaps that's not the issue?? Here's my setup for the obj_main_menu:
CREATE EVENT:
Code:
instance_deactivate_all(true);
audio_pause_all();
Code:
display_set_gui_size(view_wview[0],view_hview[0]);
draw_sprite(spr_main_menu, 0, 640, 360);
var _x,_y;
if window_get_fullscreen() {
_x = display_mouse_get_x() / display_get_width();
_y = display_mouse_get_y() / display_get_height();
} else {
_x = window_mouse_get_x() / window_get_width();
_y = window_mouse_get_y() / window_get_height();
}
x = view_xview[0] + (view_wview[0] * _x);
y = view_yview[0] + (view_hview[0] * _y);
//draw the resume button
if point_in_rectangle(x, y,460,157,818,242)
{
var hover=1;
}
else
{
var hover=0;
}
draw_sprite(spr_button_resume, hover, 640, 200);
if (mouse_check_button(mb_left)) && (hover=1)
{
instance_destroy();
audio_resume_all();
}
//draw the restart button
if point_in_rectangle(x, y,460,286,818,372)
{
var hover=1;
}
else
{
var hover=0;
}
draw_sprite(spr_button_restart, hover, 640, 330);
if (mouse_check_button(mb_left)) && (hover=1)
{
game_restart();
}
//draw the options button
if point_in_rectangle(x, y,460,416,818,502)
{
var hover=1;
}
else
{
var hover=0;
}
draw_sprite(spr_button_options, hover, 640, 460);
if (mouse_check_button(mb_left)) && (hover=1)
{
instance_destroy();
instance_create(x,y,obj_options_DEP);
}
//draw the quit button
if point_in_rectangle(x, y,460,547,818,632)
{
var hover=1;
}
else
{
var hover=0;
}
draw_sprite(spr_button_quit, hover, 640, 590);
if (mouse_check_button(mb_left)) && (hover=1)
{
game_end();
}
Code:
instance_activate_all();
Code:
instance_destroy();
audio_resume_all();
And a screenie of the "broken" menu in the 3rd and on rooms:
Any ideas on what could cause the mouse hover/sprite change to not work in the 3rd (huge) room? Thanks very much in advance for any guidance you may have to offer.