widget_text
The rows a kind drawing a caption reads: how its lines sit, break and are cut, and what the reader may do to them.
On this page
ui · 12 properties · UI
The rows a kind drawing a caption reads: how its lines sit, break and are cut, and what the reader may do to them.
In a scene, widget_text is the node key that applies it. A script reaches each property below as a field on node.widget_text: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.widget_text.get() and node.widget_text.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
line_break |
enum | word_or_glyph |
Where a wrapped line may break One of word_or_glyph, word, glyph. |
markup |
bool | false |
Read inline marks in the text: [b], [i], [color=#hex], [center], [right], [wave amp=N freq=N] and [img=path width=N]; off, brackets are text |
max_lines |
int | 0 |
The most lines a wrapped label keeps; zero keeps every line At least 0. |
on_link |
string | — | Script method called with the target of a [url=target] span in markup text that was clicked, on this node or the nearest ancestor whose script declares it |
selectable |
bool | false |
Let a drag over this label select its text, and the platform's copy key take it |
show_tooltip_when_elided |
bool | true |
Show a label's whole text when the pointer rests on it and truncate cut it short |
tab_width |
int | 8 |
Spaces between tab stops Range 1–64. |
text_align |
enum | start |
Where text sits in the width the widget was given One of start, center, end. |
text_background |
color | [0,0,0,0] |
A wash behind the text of the kinds egui draws, a checkbox, dropdown, menu, tabs, panel and the like, where a label and a button shape their own; alpha 0 is none |
truncate |
bool | false |
Cut a caption too long for the width the widget was given and end it with an ellipsis; with neither this nor wrap a button clips it at its edge. A dropdown cuts its picked text |
truncate_at |
enum | end |
Which part of a cut caption the ellipsis stands in for One of end, start, middle. |
wrap |
bool | false |
Break text to the width the widget was given instead of running past it on one line; a dropdown breaks its picked text |