Reference API Roblox

Engine API

Website

Related

Reference API Roblox

UIGridStyleLayout

The base class for grid style UI layouts.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is not browsable. It is not visible in Studio's object browser.
Tags: [NotCreatable, NotBrowsable]

Member index 7

HistoryMember
553AbsoluteContentSize: Vector2
553FillDirection: FillDirection
647HorizontalAlignment: HorizontalAlignment
553SortOrder: SortOrder
647VerticalAlignment: VerticalAlignment
573ApplyLayout(): null
573SetCustomSortFunction(function: Function = nil): null
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

The base class for grid style UI layouts.

History 36

Members 7

AbsoluteContentSize

TypeDefault
Vector2

The AbsoluteContentSize property of a UIGridStyleLayout reveals how much space the elements of the grid are taking up, including any padding created by the grid. This property is particularly useful to size containers of grids such as Frames to make sure they aren't any larger than the grid itself.

This property updates as soon as it's read. It will not fire a Object.Changed event immediately after the UI has changed, but if the value is read, it will become current and a Object.Changed event will fire on the next render step.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 8

Tags: [ReadOnly, NotReplicated]

ApplyLayout

Parameters (0)
No parameters.
Returns (1)
null

The ApplyLayout method forces sibling UI elements to be re-laid out in case the sorting criteria may have changed (such as when UIGridStyleLayout.SortOrder is set to Custom, and the UIGridStyleLayout:SetCustomSortFunction() behavior changed). Re-layouts automatically happen when UI elements are added/removed, or their Instance.Name or GuiObject.LayoutOrder change.

The manner in which sibling UI elements are laid out is dependent on the implementation of this abstract class. In other words, a concrete class like UIListLayout or UIGridLayout is responsible for the actual element positioning.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 4

Tags: [Deprecated]

FillDirection

TypeDefault
FillDirection

The FillDirection property determines the axis in which UI elements are laid out. FillDirection.Horizontal arranges objects from left to right, while FillDirection.Vertical arranges objects from top to bottom. To reverse elements, such as to arrange right to left, you'll need to reverse the sorting; for example by negating the child UI objects' GuiObject.LayoutOrder values when UIGridStyleLayout.SortOrder is set to SortOrder.LayoutOrder.

History 4

HorizontalAlignment

TypeDefault
HorizontalAlignment

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

History 5

SetCustomSortFunction

Parameters (1)Default
functionFunctionnil
Returns (1)
null

This method is deprecated. Use UIGridStyleLayout.SortOrder instead.

The function should take two arguments (each will be an Instance child to compare), and return true if a comes before b, otherwise return false. In other words, use this function the same way you would use a ' function. The sorting should be deterministic, otherwise sort will fail and fall back to name order.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 5

Tags: [Deprecated]

SortOrder

TypeDefault
SortOrder

The SortOrder property determines the order in which child UI objects are placed in a layout.

For SortOrder.LayoutOrder, an ascending sort is used on the LayoutOrder property of child UI objects. If two children share the same LayoutOrder, whichever was added sooner to the parent object takes precedence.

For SortOrder.Name, an alphanumeric sort is used on the Instance.Name of the child UI objects.

History 4

VerticalAlignment

TypeDefault
VerticalAlignment

The VerticalAlignment property determines the Y axis alignment of the grid of UI elements, much like TextLabel.TextYAlignment does with TextLabel.Text.

History 5

Settings