The text panel of Lumen (lumen_text), behind the text element. It draws its text with
the font and the color of its style, wraps it to its width unless wrap_text is false,
aligns it with text_align and vertical_align, and measures itself for the layout engine.
set_text changes the text. Derives from EditablePanel.
Summary
Methods
Methods
Draws the lines of text with the alignment of the style.
Parameters
- w Number panel width
- h Number panel height
- color Color optional, defaults to
nilcolor to draw with instead of the one of the style - offset_x Number optional, defaults to
0space taken up at the left, by an icon
Returns the font of the style, or the default Derma font.
Returns
- String
Returns the text.
Returns
- String
Returns the color of the text: the one of the style, or the text color of the theme, or white.
Returns
- Color
Measures the size the text needs, wrapped to the width available.
Parameters
- max_w Number width available, nil if unconstrained
- _max_h Number height available, nil if unconstrained
Returns
- Number width
- Number height
Measures lines of text.
Parameters
- lines List<String>
Returns
- Number width of the widest line
- Number height of all lines
Fires the press handlers of the element.
Parameters
- code Number mouse button
Draws the background of the style and the text.
Parameters
- w Number panel width
- h Number panel height
Wraps the text to the width of the panel.
Parameters
- w Number panel width
- _h Number panel height
Sets the text and lays the panel out again if it has changed.
Parameters
- text String
Splits the text into the lines that fit a width.
Parameters
- width Number width available to the text, nil to keep the lines as they are
Returns
- List<String>