Class TextElement
One line of on-screen text: what it says, its colour, and, for a help line, the keys it is about.
public record TextElement : IEquatable<TextElement>
- Inheritance
-
TextElement
- Implements
Remarks
A help line names its keys as data rather than in the text - new("H", "Reset camera"), not
new("[H] Reset camera") - and the DebugOverlay decorates them when it draws, with
KeyFormat and in KeyColor. Changing the whole
toolkit from [H] to H: is then one property, not an edit to every example.
Constructors
TextElement(IReadOnlyList<string>, string, Color?)
A help line about several keys that do the same thing: new(["Q", "E"], "Ascend / descend").
public TextElement(IReadOnlyList<string> keys, string text, Color? color = null)
Parameters
keysIReadOnlyList<string>The keys, in the order they are drawn.
textstringWhat they do, capitalised like a sentence.
colorColor?The optional color for the text.
TextElement(string, Color?)
One line of on-screen text: what it says, its colour, and, for a help line, the keys it is about.
public TextElement(string Text, Color? Color = null)
Parameters
TextstringThe text content to be displayed.
ColorColor?The optional color for the text. If null, a default color will be used.
Remarks
A help line names its keys as data rather than in the text - new("H", "Reset camera"), not
new("[H] Reset camera") - and the DebugOverlay decorates them when it draws, with
KeyFormat and in KeyColor. Changing the whole
toolkit from [H] to H: is then one property, not an edit to every example.
TextElement(string, string, Color?)
A help line about one key: new("H", "Reset camera").
public TextElement(string key, string text, Color? color = null)
Parameters
keystringThe key, as a reader would say it:
"H","Space","Mouse wheel".textstringWhat the key does, capitalised like a sentence.
colorColor?The optional color for the text.
Properties
Color
The optional color for the text. If null, a default color will be used.
public Color? Color { get; init; }
Property Value
Indented
Whether the line is drawn one marker in, so its keys sit under the key of a title with a marker. The overlay sets it for the body of a collapsible section; a dropdown sets it on its items.
public bool Indented { get; init; }
Property Value
Keys
The keys the line is about, drawn before the text and decorated by the overlay: "H",
"Space", "Arrow keys"; several when they do the same thing, drawn as [Q] [E].
public IReadOnlyList<string>? Keys { get; init; }
Property Value
Marker
A state marker drawn before the keys, in the key colour and as given: a collapsible section's
[+] or [-]. Not decorated like a key, since it is not one.
public string? Marker { get; init; }
Property Value
Text
The text content to be displayed.
public string Text { get; init; }