Skip to content
Version 2.32.0
↓ Get the launcher

TextElement.MaxLines property

Cap wrapped text at this many lines (framework 2.30.0). When the text wraps to more lines than this at its laid-out width, it shows exactly MaxLines lines and the last one ends in “…” (a cut the framework makes itself, re-fitted when the string, the font size or the width changes). The text always wraps when this is set: NoWrap and Ellipsize are ignored (MaxLines = 1 is the one-line cut). Lines break only at spaces, after hyphens and between CJK characters — never inside a word: a single word wider than the line is cut with “…” on its own line (“CombatMet…”), not split across two lines. Give it a width-constrained slot — a fixed Width or a CellElement — since the cut fits the width the layout hands it. Works with every Align, on plain and styled (Bold/Emphasis/…) text; ignored on Shadow and HUD-overlay text. The element is only as tall as the lines it shows (a one-line string stays one line tall). 0 (the default) = unlimited, unchanged. An init property (binary-compatible).

public int MaxLines { get; set; }