Daniel Posted September 8, 2013 Report Share Posted September 8, 2013 Hey all. I've been using MMF2 and I'm wondering if there is a way to center the window on the player's desktop after being resized, as resizing it leaves the window a bit to the lower right. Is there a way to auto center the window? Thanks! Link to comment Share on other sites More sharing options...
GSF Posted September 9, 2013 Report Share Posted September 9, 2013 The Window Control object should let you do this. Since the hotspot is the upper left corner, just set the window position to half of the desktop size minus half of your own window's size. I think I had a pause menu example that used this, lemme check around for a bit. EDIT: It doesn't have it, so here goes: The Window Control object lets you retrieve the screen and app window width and height values. So do it this way: *Condition --+Action *<window is resized through whatever means> --+Window Control: Set X position to (<Window Control: Screen width> / 2) - (<Window Control: Window width> / 2) --+Window Control: Set Y position to (<Window Control: Screen height> / 2)- (<Window Control: Window height> / 2) To access the values returned by the WC object, just use the "Retrieve from an object" button in the expressions editor. Link to comment Share on other sites More sharing options...
Daniel Posted September 10, 2013 Author Report Share Posted September 10, 2013 Thanks! It works like a charm. Someone off the Clickteam forums suggested the same exact method. Thank you so much. Link to comment Share on other sites More sharing options...
Recommended Posts