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

HorizontalAlignment

UIGridStyleLayout

HorizontalAlignment

The HorizontalAlignment property determines the X-axis alignment of the laid-out grid of UI elements, much like TextLabel/TextXAlignment does with TextLabel/Text.


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