Table of Contents

Class DebugOverlaySection

Namespace
Stride.CommunityToolkit.Scripts.Utilities
Assembly
Stride.CommunityToolkit.dll

One contributor's block of lines within a DebugOverlay.

public sealed class DebugOverlaySection
Inheritance
DebugOverlaySection

Remarks

Sections are what let the camera controller, a game's own instructions and any number of dropdowns share a single overlay with one position and one toggle key, instead of each drawing its own.

Properties

Collapsed

Gets or sets whether the section is currently collapsed to its title line.

public bool Collapsed { get; set; }

Property Value

bool

Remarks

Set this at registration for content a reader only needs occasionally - a list of camera keys stops earning its screen space once they are known, but a one-line reminder of how to get it back still does.

Enabled

Gets or sets whether this section is drawn. Defaults to true.

public bool Enabled { get; set; }

Property Value

bool

Remarks

Disabling removes the section entirely, breadcrumb and all. To leave a hint on screen that the content is there, collapse it with Collapsed instead.

IsCollapsible

Gets whether this section can be collapsed, which needs both a key and a title.

public bool IsCollapsible { get; }

Property Value

bool

Lines

Gets the callback producing this section's lines.

public required Func<IReadOnlyList<TextElement>> Lines { get; init; }

Property Value

Func<IReadOnlyList<TextElement>>

Remarks

Called every frame the overlay is drawn, so it can return content that changes - a body count, the state of a dropdown - without anyone having to push updates.

Name

Gets the name of the section. Used to find it again, and not displayed.

public required string Name { get; init; }

Property Value

string

Order

Gets or sets the sort order. Lower values are drawn first; ties keep insertion order.

public int Order { get; set; }

Property Value

int

Title

Gets or sets the heading shown above the section, and shown on its own while collapsed.

public string? Title { get; set; }

Property Value

string

Remarks

Required for a collapsible section - a collapsed section with no title would be invisible, and there would be nothing to tell the reader which key brings it back.

ToggleKey

Gets or sets the key that collapses and expands this section. null, the default, means the section is always shown in full.

public Keys? ToggleKey { get; set; }

Property Value

Keys?