+
+ # Horizontal text alignment
+ #
+ # Use 0.0 to align left (the default), 0.5 to align in the center or
+ # 1.0 to align on the right.
+ #
+ # See: `valign`
+ var align = 0.0 is optional, writable
+
+ # Vertical text alignment
+ #
+ # Use 0.0 for top alignment (the default) where the text is under the `anchor`,
+ # 0.5 to vertically center the text on the `anchor` or
+ # or 1.0 to bottom align the text above the `anchor`.
+ #
+ # See: `align`
+ var valign = 0.0 is optional, writable
+
+ # Maximum width of each line of text
+ #
+ # The first word of each line is exempt and may overflow.
+ #
+ # The behavior when a line overflow depends on `wrap`.
+ var max_width: nullable Float is writable
+
+ # Maximum height of this block of text
+ #
+ # The first line is exempt and may overflow.
+ # Overflowing lines are cut.
+ var max_height: nullable Float is writable
+
+ # Should overflowing lines wrap to the next line?
+ #
+ # If `true`, the default, overflowing lines continue on the next line.
+ # Otherwise, lines are cut before overflowing.
+ var wrap = true is optional, writable
+
+ # Width of the currently displayed text
+ var width = 0.0
+
+ # Height of the currently displayed text
+ var height = 0.0
+
+ # Force drawing of the text sprites
+ #
+ # This method may be called after changing a setting (`align`, `wrap`, etc.)
+ # to update the displayed text.
+ fun force_redraw
+ do
+ var t = cached_text
+ cached_text = null
+ text = t
+ end
+
+ init
+ do
+ init_complete = true
+ force_redraw
+ end