Table of Contents

Class EntityDebugSceneRendererOptions

Namespace
Stride.CommunityToolkit.Renderers
Assembly
Stride.CommunityToolkit.dll

Options for rendering debug information for entities in the scene.

public class EntityDebugSceneRendererOptions
Inheritance
EntityDebugSceneRendererOptions

Constructors

EntityDebugSceneRendererOptions()

Initializes a new instance of EntityDebugSceneRendererOptions with default settings.

public EntityDebugSceneRendererOptions()

EntityDebugSceneRendererOptions(int, Color)

Initializes a new instance of EntityDebugSceneRendererOptions with specified font size and color.

public EntityDebugSceneRendererOptions(int fontSize, Color fontColor)

Parameters

fontSize int

The size of the debug font text.

fontColor Color

The color of the debug font text.

Properties

Anchor

Gets or sets which point of the label sits on the entity's projected position. Default is TopLeft, which matches how this renderer has always placed text.

public TextAnchor Anchor { get; set; }

Property Value

TextAnchor

Remarks

BottomCenter is usually the one wanted for a label floating over an object, together with a negative Y Offset.

AutoScale

Gets or sets whether the pixel sizes - FontSize, Offset, Padding and ShadowOffset - follow the display's scale, so the labels read the same size on a 150% laptop as on a 100% monitor. Defaults to true.

public bool AutoScale { get; set; }

Property Value

bool

Remarks

The factor is the toolkit's shared DisplayScale. Turn it off for exactly the pixels asked for.

BackgroundColor

Gets or sets the color of the background behind the text.

public Color4? BackgroundColor { get; set; }

Property Value

Color4?

Remarks

Leave null for a light, half-transparent panel that suits the dark default FontColor. A background only makes sense paired with a text colour, so change both together.

EnableBackground

Gets or sets a value indicating whether to display a background behind the text.

public bool EnableBackground { get; set; }

Property Value

bool

EnableShadow

Gets or sets a value indicating whether to draw a drop shadow behind the text.

public bool EnableShadow { get; set; }

Property Value

bool

Remarks

An alternative to EnableBackground for readability, and cheaper on screen space: it costs one extra draw of the same string and does not put a panel over the scene.

EntityFilter

Gets or sets an optional test deciding which entities are labelled. Return true to label the entity.

public Func<Entity, bool>? EntityFilter { get; set; }

Property Value

Func<Entity, bool>

Remarks

The cheapest way to make a busy scene readable - narrow to one name, one component type, or whatever is actually being investigated, rather than reading every label on screen.

FontColor

Gets or sets the font color for the debug text. Default is black.

public Color FontColor { get; set; }

Property Value

Color

FontSize

Gets or sets the font size for the debug text, in pixels on a 100% display. Default is 12.

public int FontSize { get; set; }

Property Value

int

IncludeChildEntities

Gets or sets whether entities nested under others are labelled too. Default is false.

public bool IncludeChildEntities { get; set; }

Property Value

bool

Remarks

Off by default because a scene built from composed entities can hold far more children than top-level entities, and labelling all of them at once is usually unreadable. Turn it on when the thing being debugged is the hierarchy.

MaxDistance

Gets or sets the distance beyond which labels are not drawn, in world units. Leave null for no limit.

public float? MaxDistance { get; set; }

Property Value

float?

Offset

Gets or sets the offset for positioning the debug text relative to the entity. Default offset is (0, -25).

public Vector2 Offset { get; set; }

Property Value

Vector2

Padding

Gets or sets the padding around the text, in pixels.

public Vector2 Padding { get; set; }

Property Value

Vector2

PositionColor

Gets or sets a separate colour for the coordinates. Leave null to draw them in FontColor on the same line as the name.

public Color? PositionColor { get; set; }

Property Value

Color?

Remarks

Setting this moves the coordinates onto their own line beneath the name, because two colours on one line means measuring and chaining the parts, and the result is harder to read than a stack. Name and numbers are easier to tell apart when they differ in both colour and position.

ShadowColor

Gets or sets the shadow colour. Defaults to half-transparent white, to suit dark text.

public Color ShadowColor { get; set; }

Property Value

Color

ShadowOffset

Gets or sets how far the shadow sits from the text, in pixels.

public Vector2 ShadowOffset { get; set; }

Property Value

Vector2

ShowEntityName

Gets or sets a value indicating whether to show the entity's name. Default is true.

public bool ShowEntityName { get; set; }

Property Value

bool

ShowEntityPosition

Gets or sets a value indicating whether to show the entity's position.

public bool ShowEntityPosition { get; set; }

Property Value

bool

Methods

CreateDefault()

Provides default settings for rendering entity debug information.

public static EntityDebugSceneRendererOptions CreateDefault()

Returns

EntityDebugSceneRendererOptions

A new instance of EntityDebugSceneRendererOptions with default values.