Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[MMF2] How to center window


Daniel

Recommended Posts

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...