S
SpaceKill
Guest
So I'm trying to do a game-over screen but my buttons aren't visible but they're working
Here's the code
Creation code:
menu_x = x;
menu_y = y;
button_h = 32;
button[0] = "Yes"
button[1] = "Do not"
buttons = array_length_1d(button);
menu_index = 0
last_selected = 0;
Step event:
menu_move = keyboard_check_pressed(vk_left) - keyboard_check_pressed(vk_right);
menu_index += menu_move;
if (menu_index < 0) menu_index = buttons - 1;
if (menu_index > buttons -1) menu_index = 0;
if (menu_index != last_selected) audio_play_sound(Menu_Scroll,1,false);
last_selected = menu_index;
Draw event:
var i = 0;
draw_set_font(GameOver)
draw_set_halign(fa_middle)
draw_set_color(c_white)
repeat(buttons) {
draw_set_color(c_white);
if (menu_index== i) draw_set_color (c_red);
draw_text (menu_x, menu_y + button_h * i, button);
i++;
}
Key press:
switch (menu_index) {
case 0:
room_goto(room3)
break;
case 1:
room_goto(room1)
break;
}
Here's the code
Creation code:
menu_x = x;
menu_y = y;
button_h = 32;
button[0] = "Yes"
button[1] = "Do not"
buttons = array_length_1d(button);
menu_index = 0
last_selected = 0;
Step event:
menu_move = keyboard_check_pressed(vk_left) - keyboard_check_pressed(vk_right);
menu_index += menu_move;
if (menu_index < 0) menu_index = buttons - 1;
if (menu_index > buttons -1) menu_index = 0;
if (menu_index != last_selected) audio_play_sound(Menu_Scroll,1,false);
last_selected = menu_index;
Draw event:
var i = 0;
draw_set_font(GameOver)
draw_set_halign(fa_middle)
draw_set_color(c_white)
repeat(buttons) {
draw_set_color(c_white);
if (menu_index== i) draw_set_color (c_red);
draw_text (menu_x, menu_y + button_h * i, button);
i++;
}
Key press:
switch (menu_index) {
case 0:
room_goto(room3)
break;
case 1:
room_goto(room1)
break;
}
Last edited by a moderator: