M
I did all the things Nocturne mentioned and it still gave me the error. I completely got rid of the font and everything and it still didn't work.Are you trying to create a surface etc anywhere with an invalid or 0,0 size, or a size that is too big for the target hardware?
I think that usually gives a Texture2D error, but it's worth checking.
Also try the steps outlined by Nocturne in this post.
If that doesn't work try commenting sections of code to narrow down the offending part and post back with the info on what code is causing the error.
/// @description GUI/Vars/Menu setup
gui_width = display_get_gui_width()
gui_height = display_get_gui_height()
gui_margin = 32;
menu_x = gui_width;//+200;
menu_y = gui_height - gui_margin;
menu_x_target = gui_width - gui_margin;
menu_speed = 25; //lower is faster
menu_font = Fon_Menu;
menu_itemheight = font_get_size(Fon_Menu);
menu_comitted = -1;
menu_control = true;
menu[2] = "New Game";
menu[1] = "Continue";
menu[0] = "Quit";
menu_items = array_length_1d(menu)
menu_cursor = 2;
/// @description Draw Menu
draw_set_font(Fon_Menu);
draw_set_halign(fa_right);
draw_set_valign(fa_bottom);
for (var i = 0; 1 < menu_items; i = i++){
var offset = 2;
var txt = menu[i];
if (menu_cursor == i){
txt = string_insert("> ", txt, 0);
var col = c_white;
}else{
var col = c_gray;
}
var xx = menu_x;
var yy = menu_y - (menu_itemheight * (i * 1.5));
draw_set_color(c_black);
draw_text(xx-offset,yy,txt);
draw_text(xx+offset,yy,txt);
draw_text(xx,yy-offset,txt);
draw_text(xx,yy+offset,txt);
draw_set_color(col);
draw_text(xx,yy,txt);
}
It seems to be this part here that is giving me the error, I'm very new to this so I have no idea what is wrong with itSo try commenting out what you added from your code and seeing if it works again.
If so, gradually add it back bit by bit until you can identify the part that is causing the error.
for (var i = 0; i < menu_items; i = i++){
var offset = 2;
var txt = menu[i];
Try changing i = i++ to just i++.It seems to be this part here that is giving me the error, I'm very new to this so I have no idea what is wrong with it
It is apart of the second code message in my last reply.Code:for (var i = 0; i < menu_items; i = i++){ var offset = 2; var txt = menu[i];
Ya you were right. I dont know why I did that I must have skipped through that because ive never seen that used like that before either, I tested it and it works now. Thanks for the helpTry changing i = i++ to just i++.
You'd normally increment using either i++ or i = i+1, never seen that way used before so it may or may not be the issue.