PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

AutomaticSize

GuiObject

AutomaticSize

This property is used to automatically size parent UI objects based on the size of its descendants. Developers can use this property to dynamically add text and other content to a UI object at edit or run time, and the size will adjust to fit that content.

When AutomaticSize is set to an Enum/AutomaticSize|Enum.AutomaticSize value to anything other than None, this UI object may resize depending on its child content.

For more information on how to use this property and how it works, please see the following article: How to use AutomaticSize.


Code Samples


LocalScript in a ScreenGui

The following script creates an automatically-sized parent frame with a UIListLayout, then it inserts several automatically-sized TextLabel objects. Note how the parent UIListLayout automatically resizes to fit its child content and the labels automatically resize to fit their text content. This script can be parented to a ScreenGui.​