Class · inherits GuiBase2d
LayerCollector
The base class of 2D UI containers which render GuiObjects
in layers.
About LayerCollector
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
LayerCollectoritself changes.
Properties 3
Enabled
: booleanToggles the visibility of thisLayerCollector.Toggles the visibility of this
LayerCollector. Whenfalse, the UI contents will not render, process user input, or update in response to changes.ResetOnSpawn
: booleanDetermines if theLayerCollectorresets (deletes itself and re-clones into the player'sPlayerGui) every time the player's character respawns.When set to
falseand thisLayerCollectoris a direct child ofStarterGui, it will only be cloned into each player'sPlayerGuionce and it will not be deleted when the player's character respawns.When set to
true(default), or if thisLayerCollectoris an indirect descendant ofStarterGui, it will be cloned into each player'sPlayerGuiwhen their character respawns, and it will delete itself when the player's character respawns again.ZIndexBehavior
: ZIndexBehaviorControls howGuiObject.ZIndexbehaves on all descendants of thisLayerCollector.Controls how
GuiObject.ZIndexbehaves on all descendants of thisLayerCollector.With
ZIndexBehavior.Sibling(default), children always render above their parents, and theZIndexis used to decide the order in which children of a single UI object will render over each other.ZIndexBehavior.Globalsorts all descendants according to theZIndex, then breaks ties using the hierarchy order. As a result, descendants of aGuiObjectneed to have aZIndexvalue that's at least as high as the parent, or they will render underneath their parent.
LayerCollector also has every member of GuiBase2d. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.