sCat 0 -1 1 0 _menu <undefined> 1 603 7 0 0 -1 2 self 0 0 1 ///Initialize event_inherited(); opt[0] = "Resume"; opt[1] = "Item"; opt[2] = "Save"; opt[3] = "Options"; opt[4] = "Main Menu"; if(os_browser == browser_not_a_browser) { opt[5] = "Quit"; } 1 603 7 0 0 -1 2 self 0 0 1 ///Unpause unpause(); input_clear(ACTION); 1 603 7 0 0 -1 2 self 0 0 1 ///Activate options if(menudepth == instance_number(_menu)) { if(input_check_pressed(ACTION)) { switch(curOpt) { case 1: //Item instance_create(0, 0, InvMenu); break; case 2: //Save instance_create(0, 0, SaveMenu); break; case 3: //Options instance_create(0, 0, SettingsMenu); break; case 4: //Main Menu unpause(); with(Player) instance_destroy(); room_goto(rMenu); break; case 5: //Quit game_end(); break; case 0: //Back default: instance_destroy(); break; } input_clear(ACTION); } } 1 603 7 0 0 -1 2 self 0 0 1 ///Draw menu draw_background(bMenu, window_get_width() / 2 - background_get_width(bMenu) / 2, window_get_height() / 2 - background_get_height(bMenu) / 2); if(menudepth == instance_number(_menu)) { draw_set_alpha(1); draw_set_font(fMenu); if(os_browser != browser_not_a_browser) draw_set_font(fMenuHTML5); draw_set_color(c_black); draw_set_halign(fa_center); draw_set_valign(fa_bottom); for(var i = 0; i < array_length_1d(opt); i++) { if(i == curOpt) { draw_sprite( sprite_index, image_index, window_get_width() / 2 - string_width(opt[i]) / 2 - 40, window_get_height() / 2 - (array_length_1d(opt) / 2) * 32 + i * 32); draw_sprite( sprite_index, image_index + 2, window_get_width() / 2 + string_width(opt[i]) / 2 + 8, window_get_height() / 2 - (array_length_1d(opt) / 2) * 32 + i * 32); } draw_text( window_get_width() / 2, window_get_height() / 2 - (array_length_1d(opt) / 2) * 32 + (i + 1) * 32, opt[i]); } } 0 0 0 0.5 0.100000001490116 0 0.100000001490116 0.100000001490116 0.200000002980232 -1 0 0,0 16,16