Quick answer: Increase the SpriteFont object’s height. Each line consumes character height + line spacing. If the object isn’t tall enough, extra lines clip off the bottom.
A SpriteFont displays multi-line dialogue. Line 1 shows; line 2 is invisible. The text contains the newline character; the SpriteFont knows about it; but only the first line renders. The object’s height isn’t enough to fit both.
Object Height vs Line Count
SpriteFont renders within its object bounds. With character_height = 16 and line_spacing = 4, two lines need 36 pixels of height. An object 20 px tall clips line 2 entirely.
The Fix
Three options:
- Resize the object in the layout to be tall enough for max lines.
- Set sizing mode to Auto Height (object grows to fit text).
- Reduce line spacing if you have a fixed-height container.
Auto Height
In Object Type Properties → Sizing Mode → Auto Height. The object now grows vertically when you set longer text. Position the top-left and let height be dynamic.
DialogueText Set text to "Line 1\nLine 2\nLine 3"
// Object height auto-adjusts to fit 3 lines
Word Wrap for Long Strings
For unconstrained-length strings, enable Word Wrap. The object wraps at object width; auto height grows downward to fit. Combine the two for a flexible text box.
Line Spacing Sanity
If line_spacing is set to a large negative number, lines overlap. Set to 0 or positive. Negative values are accepted but rarely useful.
Vertical Alignment Trap
If vertical alignment is Middle and the object height is tighter than the text height, the top of the text clips. Center alignment with overflow truncates equally on top and bottom; bottom alignment truncates at top only. Often you want Top alignment for dialogue boxes.
Verifying
Set the text to a known 3-line string. Verify all 3 lines render. Resize the object smaller; observe which lines clip. Resize larger; all lines visible. Auto Height eliminates the manual tuning step.
“SpriteFont text bound to object dimensions. Either make the object tall enough or let it auto-grow.”
Use Auto Height for dynamic UI; fixed sizes for HUD where layout is fixed. Hybrid: max-height with overflow-scroll.