GUIs not matching sizes

I’ve set up two GUIs in Studio: the leaderboard and the settings panel. While editing, I adjusted them so they would have the same size along the Y-axis. Unfortunately, that didn’t work out.

When the screen size changes, the two GUIs end up with different proportions, as shown in the images. I’ve already tried using UIAspectRatioConstraint and the AutoScale Lite plugin, but no matter what I do, their sizes still don’t match.


What does the gui hierarchy look like? Are the 2 separate guis children of separate objects?

Yes, the two separate GUIs are children of separate ScreenGui objects.

1 Like

What are the sizes of both frames?

If they’re changing relative sizes when the screen changes size, then it means that one or both of the UIs use some sort of Offset scaling - if you need them to remain the same height at all times, then you need to give them the same Y-Scale.

1 Like

I’ve checked every single element of the GUI, and the sizes still refuse to align. I’m using UIAspectRatioConstraint though.

If you wouldn’t mind, I could take a look at the Gui file and determine why it isn’t aligning? It’s likely to do with what you mentioned regarding UIAspectRatioConstraint but it’s difficult to determine the exact reason without knowing the setup and parameters at play :slight_smile:

Sure thing! Have a go:

Leaderboard.rbxm (11.6 KB)
PrivateServerSettings.rbxm (18.5 KB)

Thanks. I’ve taken a look and played around with the UI, at 1920x1080 it’s fine, changing the aspect ratio of the screen indeed makes either UI no longer in-line with the other as you have experienced.

I played around with the UIAspectRatio settings, and these properties fixed it for me:

AspectType = ScaleWithParentSize
DominantAxis = Height

Change the properties in both panels to fix it!

I tried it on the iPhone 14 Pro, and the Settings panel looks off. Can we do something about that?

In which case I’d recommend doing the sizing more manually (without UIAspectRatioConstraint) - rely on the natural SizeConstraint property for either frame (set to RelativeYY - both X&Y will be scaled relative to the height of the parent container) and they should always remain the same height as long as they are inside the same container (or inside different containers that are exactly the same size).

Try this!
PrivateServerSettings_Fix.rbxm (20.8 KB)

1 Like

I can’t thank you enough for your help! Your fix along with some tweaks on my end worked perfectly. Cheers!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.