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.