Instances
UIListLayout
Automatically arranges sibling GUI objects in a horizontal or vertical list.
Properties
| Name | Type | Description |
|---|---|---|
FillDirection | Enum.FillDirection | Direction in which children are arranged. Default: Enum.FillDirection.Vertical. |
HorizontalAlignment | Enum.HorizontalAlignment | Horizontal alignment of the arranged content. Default: Enum.HorizontalAlignment.Left. |
VerticalAlignment | Enum.VerticalAlignment | Vertical alignment of the arranged content. Default: Enum.VerticalAlignment.Top. |
Padding | UDim | Spacing inserted between adjacent arranged children. Default: UDim.new(0, 0). |
UIListLayout affects direct visible Frame, ScrollingFrame, TextLabel and TextButton children of its parent. The layout controls their rendered positions while it is active.
If more than one layout component is directly parented to the same GUI object, the first UIListLayout or UIGridLayout in that parent's child hierarchy is used.
Ordering
Children are arranged in their hierarchy order. FillDirection selects the main axis. The alignment properties position the arranged group within the parent GUI object's bounds.
Example
Luau
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 320, 0, 240)
frame.Parent = game:GetService("StarterGui").ScreenGui
local layout = Instance.new("UIListLayout")
layout.FillDirection = Enum.FillDirection.Vertical
layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
layout.Padding = UDim.new(0, 8)
layout.Parent = frame