Table of Contents

Class DebugTextPrinter

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

A utility class for printing debug text to the screen at various positions. Manages the layout of text, allowing it to be displayed in different areas of the screen and handling multi-line printing.

public class DebugTextPrinter
Inheritance
DebugTextPrinter

Properties

DebugTextSystem

Gets or sets the debug text system responsible for rendering text to the screen.

public required DebugTextSystem DebugTextSystem { get; init; }

Property Value

DebugTextSystem

Instructions

Gets or sets the list of text elements (instructions) to be printed on the screen.

public List<TextElement> Instructions { get; init; }

Property Value

List<TextElement>

ScreenSize

Gets or sets the screen size, which defines the boundaries for placing text on the screen.

public Int2 ScreenSize { get; set; }

Property Value

Int2

TextSize

Gets or sets the size of the text elements, typically defining the dimensions of each line of text.

public Int2 TextSize { get; init; }

Property Value

Int2

Methods

ChangeStartPosition()

Changes the starting position for printing text, rotating through predefined screen positions (TopRight, BottomRight, BottomLeft, TopLeft).

public void ChangeStartPosition()

Initialize(DisplayPosition?)

Initializes the screen position by setting the starting position based on the specified display position.

public void Initialize(DisplayPosition? startPosition = null)

Parameters

startPosition DisplayPosition?

Print()

Prints all text elements in the Instructions list, rendering them line by line on the screen.

public void Print()

Print(IReadOnlyCollection<TextElement>)

Prints the specified list of text elements, rendering them line by line on the screen.

public void Print(IReadOnlyCollection<TextElement> textElements)

Parameters

textElements IReadOnlyCollection<TextElement>

UpdateScreenSize(Int2)

Updates the screen size, which defines the boundaries for placing text on the screen.

public void UpdateScreenSize(Int2 int2)

Parameters

int2 Int2