This may not make sense, but basically I have a gui right here.
I would like the frame to automatically scale it’s self depending on the length of the text, I’ve seen it in studio before with no code required. How do I do this?
Examples:
shorter text
longer text
my gui descendants
if you could edit this file itd be great, if not please let me know how to create this effect! gui.rbxm (11.7 KB)
Because we know that both the parent frame and the text are able to change size in the X direction, their AutomaticSize property should be set to X, and their size should be 0 in the X direction.
We then insert a UIListLayout to make sure the exit button is on the right side of the text element (which can be achieved by having a higher LayoutOrder).
We then insert a UIPadding instance into the TextLabel, and adjust the values to get the spacing seen here: