Interface IGuiRenderer
- Namespace
- Gloam.Core.Ui.Interfaces.Renders
- Assembly
- Gloam.Core.Ui.dll
Main GUI renderer responsible for managing and rendering GUI controls
public interface IGuiRenderer
Methods
AddControl(IGuiControl)
Adds a GUI control to be managed by this renderer
void AddControl(IGuiControl control)
Parameters
control
IGuiControlThe control to add
ClearClipRegion()
Clears the current clipping region
void ClearClipRegion()
DrawRectangle(Position, Size, Color)
Renders the outline of a rectangle
void DrawRectangle(Position position, Size size, Color color)
Parameters
position
PositionThe position of the rectangle
size
SizeThe size of the rectangle
color
ColorThe color of the outline
DrawText(string, Position, Color)
Renders text at the specified position
void DrawText(string text, Position position, Color color)
Parameters
text
stringThe text to render
position
PositionThe position to render at
color
ColorThe color of the text
FillRectangle(Position, Size, Color)
Renders a filled rectangle
void FillRectangle(Position position, Size size, Color color)
Parameters
position
PositionThe position of the rectangle
size
SizeThe size of the rectangle
color
ColorThe color to fill with
GetControlAt(Position)
Gets the control at the specified position (hit testing)
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
IGuiControl? GetFocusedControl()
Returns
- IGuiControl
The focused control or null
RemoveControl(IGuiControl)
Removes a GUI control from this renderer
bool RemoveControl(IGuiControl control)
Parameters
control
IGuiControlThe control to remove
Returns
- bool
True if the control was removed
RenderControls()
Renders all managed controls
void RenderControls()
SetClipRegion(Rectangle)
Sets the clipping region for rendering
void SetClipRegion(Rectangle rectangle)
Parameters
rectangle
RectangleThe clipping rectangle
SetFocus(IGuiControl?)
Sets focus to a specific control
void SetFocus(IGuiControl? control)
Parameters
control
IGuiControlThe control to focus (null to clear focus)
UpdateControls(IInputDevice, TimeSpan)
Updates all managed controls (handles input and state changes)
void UpdateControls(IInputDevice inputDevice, TimeSpan deltaTime)
Parameters
inputDevice
IInputDeviceThe input device for processing user input
deltaTime
TimeSpanTime elapsed since last update