<undefined>
0
-1
0
0
<undefined>
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
///Initialize
curOpt = 0;
opt[0] = "Back";
menudepth = instance_number(_menu);
image_speed = (83 * image_number) / (room_speed * 60);
1
603
7
0
0
-1
2
self
0
0
1
///Activate option
if(menudepth == instance_number(_menu)) {
if(input_check_pressed(ACTION)) {
switch(curOpt) {
case 0: //Back
default:
instance_destroy();
break;
}
input_clear(ACTION);
}
}
1
603
7
0
0
-1
2
self
0
0
1
///Cycle options
if(menudepth == instance_number(_menu)) {
if(input_check_pressed(UP)) {
curOpt = (curOpt + array_length_1d(opt) - 1) % array_length_1d(opt);
} else if(input_check_pressed(DOWN)) {
curOpt = (curOpt + 1) % array_length_1d(opt);
}
}
1
603
7
0
0
-1
2
self
0
0
1
///Close on CANCEL
if((input_check_pressed(CANCEL) || input_check_pressed(MENU)) && menudepth == instance_number(_menu)) {
instance_destroy();
input_clear(CANCEL);
input_clear(MENU);
}
1
603
7
0
0
-1
2
self
0
0
1
///Draw menu
if(menudepth == instance_number(_menu)) {
draw_set_alpha(1);
draw_set_font(fMenu);
draw_set_halign(fa_center);
draw_set_valign(fa_bottom);
draw_background(bMenu, window_get_width() / 2 - background_get_width(bMenu) / 2, window_get_height() / 2 - background_get_height(bMenu) / 2);
for(var i = 0; i < array_length_1d(opt); i++) {
if(i == curOpt) {
draw_sprite( sprite_index,
image_index,
room_width / 2 - string_width(opt[i]) / 2 - 48,
room_height / 2 - (array_length_1d(opt) / 2) * 32 + i * 32);
draw_sprite( sprite_index,
image_index + 2,
room_width / 2 - string_width(opt[i]) / 2 + 16,
room_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]);
}
}
1
603
7
0
0
-1
2
self
0
0
1
///Dont draw self
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
0