PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

FillDirection

UIGridStyleLayout

FillDirection

The FillDirection property determines the axis in which UI elements are laid out. Horizontal will arrange elements from left to right, while Vertical will arrange from top to bottom. To reverse elements (for instance, arrange right to left) you will need to reverse the sorting. This can be done by negating the child UI elements’ GuiObject/LayoutOrder values when UIGridStyleLayout/SortOrder is set to LayoutOrder.


Code Samples


UIGridLayout Fill Directions and Alignments

This code sample showcases the different alignments and fill directions that a UIGridLayout may use by iterating over the three enums using for loops.

-- Place me in a UIListLayout
local uiGridLayout = script.Parent

while true do
	for k, fillDirection in pairs(Enum.FillDirection:GetEnumItems()) do
		uiGridLayout.FillDirection = fillDirection
		for k2, verticalAlignment in pairs(Enum.VerticalAlignment:GetEnumItems()) do
			uiGridLayout.VerticalAlignment = verticalAlignment
			for k3, horizontalAlignment in pairs(Enum.HorizontalAlignment:GetEnumItems()) do
				uiGridLayout.HorizontalAlignment = horizontalAlignment
				wait(1)
			end
		end
	end
end