Hello, I’m making a GUI for my game using a unit conversion plugin and I was wondering how would I make my ui shrink accordingly to the screen
3 Likes
There are many posts on the forums that solve this issue.
Try the search button up top with terms like
GUI sizes differently
fit GUI to different screens
GUI size is wrong
and you’ll probably get a really good solution.
Here’s what I do:
- Set the frame’s anchor point to where the frame is on the screen (if its in the bottom left corner, put the anchor point in the left corner (0, 1 i think is left corner) etc, the anchor point 0.5, 0.5 (puts the anchor point in the center) is overused and should be avoided when putting frames in corners or edges of its parent)
- Use a plugin to scale the size (preferably AutoScale), position should already be scaled
- Add a UIScaleConstraint (preferably AutoScale)
You can see when scaling the window down and back up that it will scale perfectly.
More tips:
- In StarterGui, there is a ScreenOrientation setting for mobile devices. LandscapeSensor is usually the best setting.
- If you have, for example 3 buttons and u scale it some way, then the gap between the buttons will become bigger. You can fix this by putting all of the buttons in 1 frame, and repeating the process above.
- Make sure that any descendants of parent UI elements are also scaled properly. You don’t always need a UIScaleConstraint for the descendants.
What I did when I used to scale my gui’s was not use anchor point. My friend then told me about it and it instantly solved all of my problems.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.