Class DebugOverlayRenderer
Produces the debug overlay used by the desktop test application.
public sealed class DebugOverlayRenderer
- Inheritance
-
DebugOverlayRenderer
- Inherited Members
Remarks
This API is intended for engine infrastructure and advanced tooling. Prefer WorldRuntime as the stable gameplay-facing entry point.
Constructors
DebugOverlayRenderer(WorldRenderSettings, DebugBitmapFont5x7, string)
Creates a debug overlay renderer.
public DebugOverlayRenderer(WorldRenderSettings settings, DebugBitmapFont5x7 font = null, string textureKey = "debug/white")
Parameters
settingsWorldRenderSettingsThe render settings that define tile and chunk pixel sizes.
fontDebugBitmapFont5x7The debug font used for panel text.
textureKeystringThe white-pixel texture key used to draw overlay primitives.
Properties
TextureKey
public string TextureKey { get; }
Property Value
Methods
Build(WorldRuntime, WorldRenderer, Camera2D, FrameInput, ushort, string)
Builds a frame of overlay draw commands and textual panel content.
public DebugOverlayFrame Build(WorldRuntime runtime, WorldRenderer worldRenderer, Camera2D camera, FrameInput input, ushort selectedTileId, string selectionLabel = null)
Parameters
runtimeWorldRuntimeThe world runtime being inspected.
worldRendererWorldRendererThe renderer that defines the visible chunk set.
cameraCamera2DThe active camera.
inputFrameInputThe current frame input snapshot.
selectedTileIdushortThe tile currently selected by the debug application.
selectionLabelstringAn optional label that should override the default selection text.
Returns
- DebugOverlayFrame
A frame containing textual lines and generated overlay draw commands.
Draw(WorldRuntime, WorldRenderer, Camera2D, FrameInput, IRenderContext, ushort, string)
Draws the debug overlay directly into a render context.
public void Draw(WorldRuntime runtime, WorldRenderer worldRenderer, Camera2D camera, FrameInput input, IRenderContext renderContext, ushort selectedTileId, string selectionLabel = null)
Parameters
runtimeWorldRuntimeThe world runtime being inspected.
worldRendererWorldRendererThe renderer that defines the visible chunk set.
cameraCamera2DThe active camera.
inputFrameInputThe current frame input snapshot.
renderContextIRenderContextThe render context that receives overlay draw commands.
selectedTileIdushortThe tile currently selected by the debug application.
selectionLabelstringAn optional label that should override the default selection text.
TryGetHoveredTileCoord(Camera2D, FrameInput)
Attempts to resolve the world-tile coordinate currently under the cursor.
public WorldTileCoord? TryGetHoveredTileCoord(Camera2D camera, FrameInput input)
Parameters
cameraCamera2DThe camera used to transform screen-space input into world space.
inputFrameInputThe current frame input snapshot.
Returns
- WorldTileCoord?
The hovered world-tile coordinate when the cursor is inside the viewport; otherwise null.