window_center Not Workings (macOS)

As the title says. Im sure this is simple but I created an object and in the step (I tried in create as well) I placed the window_center(); function. Nothing happens. When the game loads it always anchors to the right side of my screen no matter what. I looked on help first of course, and copy pasta'd its code (which was same as mine) just incase i had a letter or something off. Same results.
 

samspade

Member
As the title says. Im sure this is simple but I created an object and in the step (I tried in create as well) I placed the window_center(); function. Nothing happens. When the game loads it always anchors to the right side of my screen no matter what. I looked on help first of course, and copy pasta'd its code (which was same as mine) just incase i had a letter or something off. Same results.
Try putting window_center in an alarm on step later. Note this message from the manual:

"NOTE: If you have resized the game window (for example, by switching from full screen to windowed), and wish to center the new window, this function should be called in an alarm[0] at least one step later than the window size change, otherwise it will not work correctly."

I'm not sure if that's exactly your issue, but it might solve it anyway.

GML:
///create event (or some other event)
alarm[0] = 1;

///alarm[0]
window_center();
 
As the title says. Im sure this is simple but I created an object and in the step (I tried in create as well) I placed the window_center(); function. Nothing happens. When the game loads it always anchors to the right side of my screen no matter what. I looked on help first of course, and copy pasta'd its code (which was same as mine) just incase i had a letter or something off. Same results.
It seems like Ultimate Camera is conflicting with it. Im working on it.
 
Top