Class GuiLayerRenderer
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
IGuiRendererThe GUI renderer to use for managing controls
priority
intThe layer priority (default: 1000)
name
stringThe name of the layer (default: "GUI")
Properties
GuiRenderer
Gets the GUI renderer used by this layer
public IGuiRenderer GuiRenderer { get; }
Property Value
Name
Gets the name of this layer renderer for debugging and identification purposes.
public override string Name { get; }
Property Value
Priority
Gets the priority of this layer renderer. Lower values render first.
public override int Priority { get; }
Property Value
Methods
AddControl(IGuiControl)
Adds a GUI control to be managed by this layer
public void AddControl(IGuiControl control)
Parameters
control
IGuiControlThe control to add
GetControlAt(Position)
Gets the control at the specified position (hit testing)
public IGuiControl? GetControlAt(Position position)
Parameters
position
PositionThe 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
IGuiControlThe 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
RenderLayerContextThe rendering context containing renderer, input, and frame information
ct
CancellationTokenCancellation token to cancel the rendering operation
Returns
SetFocus(IGuiControl?)
Sets focus to a specific control
public void SetFocus(IGuiControl? control)
Parameters
control
IGuiControlThe control to focus (null to clear focus)