ui.RichText

ui.RichText

class

Wrapping body text the way the game's descriptions read: tokens such as {item:Name} become links with icons, <blue>, <yellow>, <red> and <green> tint a run

Fields

NameTypeDescription
text string Source UTF-8 text, tokens and tags unexpanded
font_size number Font size in slate units
align string Where the lines sit: "left", "center" or "right"
color string Color of the text outside tinted runs, same forms as ui.Text color
wrap boolean True, the default, breaks long lines at the width the text is given; false keeps one line
Inherited from ui.Widget (3)
  • visible Hidden widgets keep their place in the tree and take no input
  • fill Share of the free space this widget takes along an HBox or VBox; zero keeps it at the size of its content
  • valign Where the widget sits in the height of an HBox row: "fill", "top", "center" or "bottom"
Inherited from Object (5)