Table of Contents

Class WorldTextRenderer

Namespace
Stride.CommunityToolkit.Rendering.Text
Assembly
Stride.CommunityToolkit.dll

Draws every WorldTextComponent as text standing in the 3D scene rather than over it.

public class WorldTextRenderer : SceneRendererBase, IComponent, IReferencable, ICollectorHolder, ISceneRenderer, IRenderCollector, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
Inheritance
WorldTextRenderer
Implements
Inherited Members

Remarks

WorldTextProcessor adds one to the scene's compositor when the scene has a WorldTextComponent. Each text is drawn at its entity's transform, scaled by perspective and, by default, hidden by geometry in front of it.

How it works, and what it costs. SpriteBatch can be given explicit view and projection matrices, which turns its 2D quads into geometry positioned in world space. Folding each text's world matrix into the view matrix places and orients it, and the depth state decides whether the scene occludes it. The catch is that the matrices belong to the batch rather than the draw call, so each text needs its own Begin/End pair and therefore its own draw call: fine for tens of labels, not for thousands.

Fields

ProfilingKey

The block the profiler shows this renderer's GPU time under.

public static readonly ProfilingKey ProfilingKey

Field Value

ProfilingKey

Methods

Destroy()

protected override void Destroy()

DrawCore(RenderContext, RenderDrawContext)

protected override void DrawCore(RenderContext context, RenderDrawContext drawContext)

Parameters

context RenderContext
drawContext RenderDrawContext

InitializeCore()

protected override void InitializeCore()