Table of Contents

Class Run

Namespace
MagicUI.Elements
Assembly
MagicUI.dll

Represents a segment of text with optional formatting attributes like bold, italic, size, and color. Used within TextObject to create rich text with mixed formatting.

public record Run : IEquatable<Run>
Inheritance
Run
Implements
Inherited Members

Constructors

Run(string)

Initializes a new instance of the Run class with the specified text.

public Run(string text)

Parameters

text string

The text content of this run.

Properties

Bold

Gets whether the text should be displayed in bold.

public bool Bold { get; init; }

Property Value

bool

Color

Gets the optional color override for this text run. If null, uses the parent TextObject's color.

public Color? Color { get; init; }

Property Value

Color?

Italic

Gets whether the text should be displayed in italic.

public bool Italic { get; init; }

Property Value

bool

Size

Gets the optional font size override for this text run. If null, uses the parent TextObject's font size.

public int? Size { get; init; }

Property Value

int?

Text

Gets the text content of this run.

public string Text { get; init; }

Property Value

string

Methods

ToString()

Converts the run to its rich text string representation with all formatting applied.

public override string ToString()

Returns

string

A string containing the text with Unity rich text tags for the applied formatting.