Reference API Roblox

Engine API

Website

Related

Reference API Roblox

LayerCollector

The base class of 2D UI containers which render GuiObjects in layers.

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 5

HistoryMember
553Enabled: bool
553ResetOnSpawn: bool
553ZIndexBehavior: ZIndexBehavior
648GetGuiObjectsAtPosition(x: int, y: int): Instances
462GetLayoutNodeTree(): Dictionary
inherited from GuiBase2d
553AbsolutePosition: Vector2
553AbsoluteRotation: float
553AbsoluteSize: Vector2
553AutoLocalize: bool
553RootLocalizationTable: LocalizationTable
553SelectionBehaviorDown: SelectionBehavior
553SelectionBehaviorLeft: SelectionBehavior
553SelectionBehaviorRight: SelectionBehavior
553SelectionBehaviorUp: SelectionBehavior
553SelectionGroup: bool
525SelectionChanged(amISelected: bool, previousSelection: GuiObject, newSelection: GuiObject)
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

LayerCollector is the base class of 2D UI containers which render GuiObject descendants, such as ScreenGui.

For performance improvements, the appearance of a LayerCollector is cached until one of the following events occurs:

  • A descendant is added to or removed from it.
  • A property of a descendant changes.
  • A property of the LayerCollector itself changes.

History 20

Members 5

Enabled

TypeDefault
bool

Toggles the visibility of this LayerCollector. When false, the UI contents will not render, process user input, or update in response to changes.

History 6

GetGuiObjectsAtPosition

Parameters (2)
xint
yint
Returns (1)
Instances

History 2

GetLayoutNodeTree

Parameters (0)
No parameters.
Returns (1)
Dictionary
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

ResetOnSpawn

TypeDefault
bool

When set to false and this LayerCollector is a direct child of StarterGui, it will only be cloned into each player's PlayerGui once and it will not be deleted when the player's character respawns.

When set to true (default), or if this LayerCollector is an indirect descendant of StarterGui, it will be cloned into each player's PlayerGui when their character respawns, and it will delete itself when the player's character respawns again.

History 4

ZIndexBehavior

TypeDefault
ZIndexBehavior

Controls how GuiObject.ZIndex behaves on all descendants of this LayerCollector.

With ZIndexBehavior.Sibling (default), children always render above their parents, and the ZIndex is used to decide the order in which children of a single UI object will render over each other.

ZIndexBehavior.Global sorts all descendants according to the ZIndex, then breaks ties using the hierarchy order. As a result, descendants of a GuiObject need to have a ZIndex value that's at least as high as the parent, or they will render underneath their parent.

History 4

Settings