We can use objects such as “UIGridLayot” “UIPadding” “UISizeConstraint” etc. for a UI, but I have no idea what they do, can you help?
They’re basically objects that further dictate what a UI element can do.
For example, putting a UIListLayout
under a ScrollingFrame
will force all objects within the scrolling frame to abide by a list-like layout.
It’s useful for quickly creating a scrollable list.
Another example is the UIAspectRatioConstraint
that forces a UI element to abide by a specific aspect ratio.
Pretty useful if you have logos or icons that you want to remain in a specific “shape”.
The one that I (ab)use the most is UIPadding
, since it adds a padding (an empty space) in any side of my text.
Makes it look cleaner than having the text completely “stick” to a side.
UISizeConstraint
makes sure GuiObject aren’t larger than the MaxSize or smaller than the MinSize
(the dark yellow frame would never be bigger than the light yellow frame and it would never be be smaller than half of the light frame’s size)
UIGridLayout
would put GuiObjects in a grid like layout
UIPadding
would make GuiObjects be a certain amount of pixels away from the parent’s sides
you could also do negative values for all of these
(i did -80 on all)
UIListLayout
keeps GuiObjects positioned based off their LayoutOrder or Name
you should look at the documentation for these
https://create.roblox.com/docs/reference/engine/classes/class-name-here
https://create.roblox.com/docs/reference/engine/classes/UIListLayout
I forgot, but two key things to keep in mind:
1) UI Objects will override certain properties of the parent element that it is affecting.
Eg: using a UIListLayout on a ScrollingFrame will soft-lock the position properties of the children under the scrolling frame.
You can still change them, but it won’t tangibly change anything until you remove the UIListLayout.
You can spot a soft-locked property when it is labelled with a red exclamation mark logo on the properties page.
2) UI Objects are scriptable.
Self-explanatory.
Thanks for your all messages.