Skip to content
Version 2.11.0
↓ Get the launcher

TextElement record

Themed text. Color Func null (or returns null) = framework default; a Func lets colour animate per-refresh (e.g. delta-flash). Width > 0 fixes the cell width (the text wraps within it) — use to form aligned columns (e.g. a plugin-name column so the version after it starts at a consistent x). Align sets horizontal alignment (Right for numeric columns). Shadow draws a dark outline behind the glyphs — for chrome-less overlays (a borderless HUD with no background) where light text must stay legible over arbitrary world backgrounds. ShadowDistance controls the pixel offset of the shadow (default 1). Increase for large font sizes where a 1-pixel shadow is invisible. NoWrap keeps the text on a single line (any overflow spills/clips at the cell edge rather than wrapping to multiple lines) — use in a fixed-width pane where a long label (e.g. a map name) must read as one row, not a 5-line block.

public record TextElement : IEquatable<HudElement>
name description
TextElement(…) Themed text. Color Func null (or returns null) = framework default; a Func lets colour animate per-refresh (e.g. delta-flash). Width > 0 fixes the cell width (the text wraps within it) — use to form aligned columns (e.g. a plugin-name column so the version after it starts at a consistent x). Align sets horizontal alignment (Right for numeric columns). Shadow draws a dark outline behind the glyphs — for chrome-less overlays (a borderless HUD with no background) where light text must stay legible over arbitrary world backgrounds. ShadowDistance controls the pixel offset of the shadow (default 1). Increase for large font sizes where a 1-pixel shadow is invisible. NoWrap keeps the text on a single line (any overflow spills/clips at the cell edge rather than wrapping to multiple lines) — use in a fixed-width pane where a long label (e.g. a map name) must read as one row, not a 5-line block. (3 constructors)
Align { get; set; }
Bold { get; set; } Render in real bold weight — a designed bold FACE in every script (Latin, Thai, CJK, …), never Unity’s synthetic bold. Window surfaces only (HUD-overlay text ignores the style flags). Emphasis already implies bold at header size; use this for bold at normal size.
Color { get; set; }
DynamicFontSize { get; set; } When non-null, overrides FontSize and is re-evaluated each HUD refresh. Use with ScreenHeight to scale text with screen resolution: DynamicFontSize = () => services.Framework.ScreenHeight / 19.
Emphasis { get; set; }
FontSize { get; set; }
Italic { get; set; } Slant the glyphs (synthetic italic — safe in every script). Window surfaces only.
NoWrap { get; set; }
Shadow { get; set; }
ShadowDistance { get; set; }
Strikethrough { get; set; } Draw a line through the text (works in every script). Window surfaces only.
Text { get; set; }
Underline { get; set; } Draw an underline beneath the text (works in every script). Window surfaces only.
Width { get; set; }