Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Keeping a GUI centered when resizing?

Asked by
3Ig 0
6 years ago

How would I go about keeping a GUI centered when resizing it? I am trying to make a GUI that you can increase in size by pressing '+' and decrease by pressing '-'. This works, but whenever I change the size, it just expands towards the lower right corner of the screen instead of staying centered and expanding in all directions.

Let me know if you need me to explain the issue better.

0
In order to counterbalance the change in size, you must subtract (or add) half the change in size from the matching position. So, say each time one clicks '+', the GUI size is increased by 50 on both the x and y-axis. To keep the GUI centered, subtract 25 (half of 50) from the GUI position on both the x and y-axis. Posting the code you currently have would help supply an answer. Mindmixer 0 — 6y
0
I got it working. Thanks though. 3Ig 0 — 6y

Answer this question