I have a game that has a lot of gui's, but they become off-centered and no longer have edges that match up the way I want them to anymore when the resolution changes. Is there a way to make gui's become smaller in all directions as the resolution becomes smaller to prevent this?
When creating GUI, you will notice the default size is usually something like {0,100},{0,100} for frames and {0, 200},{0, 50} for TextLabel
and TextBox
. The first and third digits are called Scale
. The second and fourth digits are called Offset
. You should always use Scale
to avoid GUIs from going off-screen. Scale
will make sure the GUI fit on the screen.
Example 1: If you're trying to set a GUI to cover the full screen, the
UDim2
value can be set to {1,0},{1,0}Example 2: If you're trying to set a GUI to the center of the screen, we will use
AnchorPoint
. Set the AnchorPoint value to 0.5,0.5. This will move the GUI to the center of the screen. Now you can use the Scale values to make the GUI however large you want.