P
Pepasone
Guest
This seems like it should be insanely simple, but it just isn't working for some reason. It should resize the window, set the GUI to match the new window size, kick off an alarm to center the window on the display the next step, tell all the UI elements to reposition themselves based on a percentage. What function am I not using correctly?
- I will say that for like 1 second, it goes to where it seems like it should go, but then bounces back.
- If I add the same code to the step event of par_ui, the items hold their position just fine:
- So the question is, why does the first block of code, not permanently keep the objects in place?
GML:
// Resize the Window & GUI
window_set_size(960, 540);
display_set_gui_size(-1, -1);
// Center the window via an alarm as this can't occur in the same step
par_ui.alarm[0] = 1;
// Move the UI elements
with par_ui
{
x = floor(display_get_gui_width() * window_x);
y = floor(display_get_gui_height() * window_y);
}
- If I add the same code to the step event of par_ui, the items hold their position just fine:
GML:
/// Lock the position in the step event
x = floor(display_get_gui_width() * window_x);
y = floor(display_get_gui_height() * window_y);