Table of Contents

Class GuiLayerRenderer

Namespace
Gloam.Core.Ui
Assembly
Gloam.Core.Ui.dll

Layer renderer that bridges the layer system with GUI controls using IGuiRenderer

public sealed class GuiLayerRenderer : BaseLayerRenderer, ILayerRenderer
Inheritance
GuiLayerRenderer
Implements
Inherited Members

Constructors

GuiLayerRenderer(IGuiRenderer, int, string)

Initializes a new instance of GuiLayerRenderer

public GuiLayerRenderer(IGuiRenderer guiRenderer, int priority = 1000, string name = "GUI")

Parameters

guiRenderer IGuiRenderer

The GUI renderer to use for managing controls

priority int

The layer priority (default: 1000)

name string

The name of the layer (default: "GUI")

Properties

GuiRenderer

Gets the GUI renderer used by this layer

public IGuiRenderer GuiRenderer { get; }

Property Value

IGuiRenderer

Name

Gets the name of this layer renderer for debugging and identification purposes.

public override string Name { get; }

Property Value

string

Priority

Gets the priority of this layer renderer. Lower values render first.

public override int Priority { get; }

Property Value

int

Methods

AddControl(IGuiControl)

Adds a GUI control to be managed by this layer

public void AddControl(IGuiControl control)

Parameters

control IGuiControl

The control to add

GetControlAt(Position)

Gets the control at the specified position (hit testing)

public IGuiControl? GetControlAt(Position position)

Parameters

position Position

The position to test

Returns

IGuiControl

The topmost control at the position or null

GetFocusedControl()

Gets the currently focused control

public IGuiControl? GetFocusedControl()

Returns

IGuiControl

The focused control or null

RemoveControl(IGuiControl)

Removes a GUI control from this layer

public bool RemoveControl(IGuiControl control)

Parameters

control IGuiControl

The control to remove

Returns

bool

True if the control was removed

RenderLayerAsync(RenderLayerContext, CancellationToken)

Override this method to implement the specific rendering logic for this layer.

protected override ValueTask RenderLayerAsync(RenderLayerContext context, CancellationToken ct = default)

Parameters

context RenderLayerContext

The rendering context containing renderer, input, and frame information

ct CancellationToken

Cancellation token to cancel the rendering operation

Returns

ValueTask

SetFocus(IGuiControl?)

Sets focus to a specific control

public void SetFocus(IGuiControl? control)

Parameters

control IGuiControl

The control to focus (null to clear focus)