Skip to content
Version 2.32.0
↓ Get the launcher

TextAreaElement record

Multi-line editable text box (wraps UGuiTextInput in multi-line mode). Enter inserts a REAL newline and KEEPS focus — it does NOT submit; give the plugin its own submit button that reads the current buffer via OnChange. The box is a FIXED height (Lines visible lines) that NEVER grows the window: text wraps within the width and overflows downward, clipped to the box and scrolled vertically to follow the caret. Esc defocuses and the cursor stays free, same as InputElement. Get seeds the text; OnChange fires per edit with the FULL buffer (newlines included). Set ReadOnly for a select/copy-only display box (e.g. a generated code the user copies out). Add any later options as init properties, never new positional parameters (see WindowBuilder-Patterns.md “Binary compatibility rules”).

public record TextAreaElement : IEquatable<HudElement>
name description
TextAreaElement(…) Multi-line editable text box (wraps UGuiTextInput in multi-line mode). Enter inserts a REAL newline and KEEPS focus — it does NOT submit; give the plugin its own submit button that reads the current buffer via OnChange. The box is a FIXED height (Lines visible lines) that NEVER grows the window: text wraps within the width and overflows downward, clipped to the box and scrolled vertically to follow the caret. Esc defocuses and the cursor stays free, same as InputElement. Get seeds the text; OnChange fires per edit with the FULL buffer (newlines included). Set ReadOnly for a select/copy-only display box (e.g. a generated code the user copies out). Add any later options as init properties, never new positional parameters (see WindowBuilder-Patterns.md “Binary compatibility rules”).
Get { get; set; } Supplies the initial text (and re-seeds on external change, diffed like InputElement). It keeps driving the content when ReadOnly: change what it returns to replace the shown text.
Lines { get; set; } Number of visible text lines → the box’s FIXED height (it never grows past this; overflow scrolls). Default 4. An init property so future additions stay binary-compatible.
OnChange { get; set; } Invoked per edit with the full buffer (newlines kept) — the plugin’s submit button reads this. With ReadOnly the user can’t edit, so it never fires from user input (a Get re-seed may still echo through it); it stays required for API stability — pass a no-op.
ReadOnly { get; set; } Read-only display (uGUI InputField.readOnly): the user can still focus the box, place the caret, select with mouse or keyboard (Shift+arrows, Ctrl+A) and copy (Ctrl+C), but typing, paste, cut and delete are blocked. Scrollbar, wheel and caret-follow keep working; focus suppresses the game’s keys as usual, so Ctrl+C never reaches a game binding. The box bg is drawn slightly more translucent as a subtle “not editable” hint. Default false = the normal editable box, unchanged. An init property (binary-compatible).
Width { get; set; } Fixed box width in px.