Gamerev147
Member
I have a controller object for my GUI which creates a global list and draws the objects in the list from last to first. The objects are essentially windows that simply add their ID to the list.
It goes as follows:
obj_WindowController - Create
obj_WindowController - Draw GUI
And as I said before, the obj_Window simply adds its ID to the global list.
My problem is that the windows just don't draw. And when I try to create multiple of them, my game freezes.
What am I doing wrong? Any help is appreciated.
Thanks!
It goes as follows:
obj_WindowController - Create
GML:
globalvar WINDOWS;
WINDOWS = ds_list_create();
GML:
if (!ds_list_empty(WINDOWS)) {
for (var i = ds_list_size(WINDOWS); i > 0; i--) {
var window_id = ds_list_find_value(WINDOWS, i);
if (window_id != 0) && (window_id != undefined) {
with (window_id) {
draw_set_color(c_gray);
draw_roundrect(xx, yy, ww, hh, false);
draw_set_color(c_white);
draw_roundrect(xx, yy, ww, hh, true);
//etc...
}
}
}
}
My problem is that the windows just don't draw. And when I try to create multiple of them, my game freezes.
What am I doing wrong? Any help is appreciated.
Thanks!