Game Development Community

Center GUI

by Anthony Merlo · in Torque 3D Professional · 07/16/2011 (9:44 pm) · 1 replies

I looked but cant seem to find anywhere how to center a GUI on the screen. I see a setting for position and extent but not just to set it centered on the screen.

Is there a simple way to do this or do I have to write script to calculate the position using the GUI size and game window size? If so any help on this would be appreciated. Thanks!

#1
07/17/2011 (4:59 am)
In the gui controls script definition, change the following lines:

horizSizing = "center";
   vertSizing = "center";

There are other parameters you can input here but check the docs, this the code so you don't have to manually resize anything on resolution changes.