UISizeConstraint should take in UDim2 values for MaxSize and MinSize

Currently, UISizeContraint is limited in its usage possibilities. The current MinSize and MaxSize properties only take in absolute values, giving no opportunity for developers to specify relative size constraints.

With the introduction of AutomaticSize, having control over the max size relative to the screen is very useful. Here’s an example:

In the image above, there are three widgets (top, middle, and bottom). The bottom and middle widgets are static in size so their exact size is always known. However, the topmost widget is not static in size as the container will expand once more content is added (as shown below):

Currently, there is no problem as no widgets overlap each other. But, take this scenario:

Now, there is too much content within the frame, and so the topmost widget overflows the middle widget. To alleviate the issue, we can use a UISizeContraint to prevent the topmost widget from overflowing (note that there’s a bug with using both AutomaticSize and UISizeContraint in combination so the following image is only a simulated version):

Sure, this looks fine right now, right? The overflowing issue has been fixed! Unfortunately:

It will still overflow when the screen size is smaller.

The solution to this problem would be to allow developers to specify a MaxSize for GuiObjects using UDim2 values so that developers can specify relative max sizes that allow for guis to fill in extra screen estate on larger screens and prevent overflow on smaller screens.

6 Likes

Look into this post here, I’ve discovered great success with merging UISizeConstraints, AutomaticSize, and the new UIFlexGroups.

With my old UI I use to use a mixture of all Scaled objects and UIAspectRatios which allowed for the UI to fit on all screens sure but It didn’t look good on smaller screens due to it being way to small.

Switching to my new methods of UISizeConstraints, AutomaticSize, And UIFlexGroups I haven’t used any UIAspectRatios recently and have adapted my UI to scale dynamically with all screen sizes.

1 Like