LayerCollector
The base class of 2D UI containers which render GuiObjects in layers.
Memory category | Instances |
---|
Member index 5
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
- 648 Change ReturnType of GetGuiObjectsAtPosition from Objects to Instances
- 622 Add GetGuiObjectsAtPosition
- 553 Change Default of ZIndexBehavior from to
- 553 Change Default of ResetOnSpawn from to
- 553 Change Default of Enabled from to
- 486 Change ThreadSafety of ZIndexBehavior from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ResetOnSpawn from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Enabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of GetLayoutNodeTree from to Unsafe
- 462 Change ThreadSafety of ZIndexBehavior from to ReadOnly
- 462 Change ThreadSafety of ResetOnSpawn from to ReadOnly
- 462 Change ThreadSafety of Enabled from to ReadOnly
- 452 Add GetLayoutNodeTree
- 329 Add ResetOnSpawn
- 317 Add ZIndexBehavior
- 317 Change Tags of LayerCollector from [NotCreatable] to [NotCreatable, NotBrowsable]
- 310 Add Enabled
- 257 Remove Enabled
- 258 Add Enabled
- 87 Add LayerCollector
Members 5
Enabled
Type | Default | |
---|---|---|
bool |
Toggles the visibility of this LayerCollector. When false
, the
UI contents will not render, process user input, or update in response to
changes.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
GetGuiObjectsAtPosition
Parameters (2) | ||
---|---|---|
x | int | |
y | int | |
Returns (1) | ||
Instances |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 648 Change ReturnType of GetGuiObjectsAtPosition from Objects to Instances
- 622 Add GetGuiObjectsAtPosition
GetLayoutNodeTree
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Dictionary |
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetLayoutNodeTree from to Unsafe
- 452 Add GetLayoutNodeTree
ResetOnSpawn
Type | Default | |
---|---|---|
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.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of ResetOnSpawn from to
- 486 Change ThreadSafety of ResetOnSpawn from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ResetOnSpawn from to ReadOnly
- 329 Add ResetOnSpawn
ZIndexBehavior
Type | Default | |
---|---|---|
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.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of ZIndexBehavior from to
- 486 Change ThreadSafety of ZIndexBehavior from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ZIndexBehavior from to ReadOnly
- 317 Add ZIndexBehavior