K
Kyle Rider
Guest
Hey all, looking at changing my option menu from a 1D array to 2D.
The problem I have with it being a 1D array is controlling the menu.
I have 3 columns in my menu. being a 1D array the pressing left or right should change the rows but it doesn't function all the time and is just horrible.
I will start tinkering with how to draw a 2D array but if any of you can point me to read anything the manual really doesn't help.
Here is my current code.
The problem I have with it being a 1D array is controlling the menu.
I have 3 columns in my menu. being a 1D array the pressing left or right should change the rows but it doesn't function all the time and is just horrible.
I will start tinkering with how to draw a 2D array but if any of you can point me to read anything the manual really doesn't help.
Here is my current code.
Code:
for (m = 0; m < array_length_1d(menu); m += 1)
{
if (m <= 3)
{
if move = m
{
draw_set_halign(fa_right);
draw_set_valign(fa_top);
draw_set_color(c_blue);
draw_set_font(f_dialogue);
draw_text(display_get_gui_width()/2 - 400, 136 +(64* m),string(menu[m]));
} else
{
draw_set_halign(fa_right);
draw_set_valign(fa_top);
draw_set_color(c_white);
draw_set_font(f_dialogue);
draw_text(display_get_gui_width()/2 - 400, 136 +(64* m),string(menu[m]));
}
}
if (m > 3) && (m <= 8)
{
if move = m
{
draw_set_halign(fa_left);
draw_set_valign(fa_top);
draw_set_color(c_blue);
draw_set_font(f_dialogue);
draw_text(display_get_gui_width()/2 - 250, 136 +(64* (m - 4)),string(menu[m]));
} else
{
draw_set_halign(fa_left);
draw_set_valign(fa_top);
draw_set_color(c_white);
draw_set_font(f_dialogue);
draw_text(display_get_gui_width()/2 - 250, 136 +(64* (m - 4)),string(menu[m]));
}
}
if (m >8) && (m <= 10)
{
if move = m
{
draw_set_halign(fa_left);
draw_set_valign(fa_top);
draw_set_color(c_blue);
draw_set_font(f_dialogue);
draw_text(display_get_gui_width()/2 + 340, 136 +(64* (m - 9)),string(menu[m]));
} else
{
draw_set_halign(fa_left);
draw_set_valign(fa_top);
draw_set_color(c_white);
draw_set_font(f_dialogue);
draw_text(display_get_gui_width()/2 + 340, 136 +(64* (m - 9)),string(menu[m]));
}
}
if (m >= 11)
{
if move = m
{
draw_set_halign(fa_center);
draw_set_valign(fa_top);
draw_set_color(c_blue);
draw_set_font(f_dialogue);
draw_text(display_get_gui_width()/2, display_get_gui_height() - 150 + (50* (m-12)),string(menu[m]));
} else
{
draw_set_halign(fa_center);
draw_set_valign(fa_top);
draw_set_color(c_white);
draw_set_font(f_dialogue);
draw_text(display_get_gui_width()/2, display_get_gui_height() - 150 + (50* (m-12)),string(menu[m]));
}
}
}