Looks like you've almost got a grasp of it! What you'll want to focus on is this section right here:
Code:
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++;
}
It appears that your menu is being drawn like this:
Instead of like this:
If this is the case, simply handle changing the position you're drawing the cursor sprite in the same way you're changing the position of the text being drawn.
Code:
//cursor_x_offset is how far to the left of the text the cursor is to be drawn
var cursor_x_offset = -16;
repeat(buttons) {
draw_set_color(c_white);
if (menu_index== i) {
draw_set_color (c_red);
//You may have to fine-tune the position of the cursor sprite to get it to show up exactly where you want
draw_sprite(spr_cursor, 0, menu_x + cursor_x_offset, menu_y + button_h * i);
}
draw_text (menu_x, menu_y + button_h * i, button[i]);
i++;
}
As a friendly reminder, if you want your code formatted on the forums like I've been doing it, just put your code inside code brackets like this:
[_code_]var x = 1;[_/code_]
Without the underscores the underscores it becomes
And it's much easier to read.