Table of Contents

Class StyledText

Namespace
RatatuiUnity

Fluent builder for styled paragraphs with per-span colors and text modifiers.

public sealed class StyledText
Inheritance
StyledText
Inherited Members

Examples

term.BeginStyledParagraph(area, Alignment.Left, wrap: true)
    .Span("Status: ")
    .Span("OK", fg: Color.green, modifiers: Modifier.Bold)
    .Line()
    .Span("Error count: ")
    .Span("3", fg: Color.red)
    .Render();

Methods

Line()

Move to a new line in the paragraph.

public StyledText Line()

Returns

StyledText

Render()

Finalize and enqueue the styled paragraph widget command. Must be called exactly once; the builder is unusable afterward.

public void Render()

Span(string, Color, Color, Modifier)

Append a styled span to the current line. Use Color.clear for fg / bg to keep the terminal default color.

public StyledText Span(string text, Color fg = default, Color bg = default, Modifier modifiers = Modifier.None)

Parameters

text string
fg Color
bg Color
modifiers Modifier

Returns

StyledText

SpanLine(string, Color, Color, Modifier)

Convenience: append a span then immediately start a new line. Equivalent to .Span(text, fg, bg, modifiers).Line().

public StyledText SpanLine(string text, Color fg = default, Color bg = default, Modifier modifiers = Modifier.None)

Parameters

text string
fg Color
bg Color
modifiers Modifier

Returns

StyledText