# LayerCollector

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [GuiBase2d](https://rapi.sleaze.dev/classes/GuiBase2d.md), [GuiBase](https://rapi.sleaze.dev/classes/GuiBase.md), [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Subclasses: [BillboardGui](https://rapi.sleaze.dev/classes/BillboardGui.md), [PluginGui](https://rapi.sleaze.dev/classes/PluginGui.md), [ScreenGui](https://rapi.sleaze.dev/classes/ScreenGui.md), [SurfaceGuiBase](https://rapi.sleaze.dev/classes/SurfaceGuiBase.md)
- Tags: Not browsable, Not creatable
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/LayerCollector/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/LayerCollector

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

## Properties

### Enabled

```luau
LayerCollector.Enabled: boolean
```

- Tags: Read capabilities: UI

Toggles the visibility of this [`LayerCollector`](https://rapi.sleaze.dev/classes/LayerCollector.md).

### ResetOnSpawn

```luau
LayerCollector.ResetOnSpawn: boolean
```

- Tags: Read capabilities: UI

Determines if the [`LayerCollector`](https://rapi.sleaze.dev/classes/LayerCollector.md) resets (deletes itself and re-clones into the player's [`PlayerGui`](https://rapi.sleaze.dev/classes/PlayerGui.md)) every time the player's character respawns.

### TabKeyboardNavigation

```luau
LayerCollector.TabKeyboardNavigation: boolean
```

- Tags: Hidden, Not replicated, Roblox script security, Read capabilities: UI

### ZIndexBehavior

```luau
LayerCollector.ZIndexBehavior: Enum.ZIndexBehavior
```

- Tags: Read capabilities: UI

Controls how [`GuiObject.ZIndex`](https://rapi.sleaze.dev/classes/GuiObject.md) behaves on all descendants of this [`LayerCollector`](https://rapi.sleaze.dev/classes/LayerCollector.md).

## Methods

### GetGuiObjectsAtPosition

```luau
LayerCollector:GetGuiObjectsAtPosition(x: number, y: number): { Instance }
```

- Tags: Capabilities: UI

### GetLayoutNodeTree

```luau
LayerCollector:GetLayoutNodeTree(): { [string]: any }
```

- Tags: Deprecated, Capabilities: UI

**Deprecated:** This method should not be used for new work.

## Inherited members

- From [GuiBase2d](https://rapi.sleaze.dev/classes/GuiBase2d.md): `AbsolutePosition`, `AbsoluteRotation`, `AbsoluteSize`, `ActiveQueryNames`, `ReplicatedInsertionOrder`, `ClippedRect`, `IsNotOccluded`, `RawRect2D`, `TotalGroupScale`, `AutoLocalize`, `RootLocalizationTable`, `Localize`, `SelectionBehaviorDown`, `SelectionBehaviorLeft`, `SelectionBehaviorRight`, `SelectionBehaviorUp`, `SelectionGroup`, `SelectionChanged`
- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
