Skip to content

Components

Text

A run of text: a label, a heading, a line of dialogue. Turn on Wrap to break long lines at spaces to fit the box. Turn on Rich to read [b]...[/b] markup, and advance Visible Characters for a typewriter reveal. Goes under a Canvas.

On this page

Add it

+ Add node → Label, Localized Label, Button, Menu Button, Toggle, Dropdown, Virtual Button creates a node with it already on. Already have a node for it? Add component → TextComponent.

From a script

A script on the same node writes these fields by name. TextComponent is the name to pass.

rgs
set_text("TextComponent", "text", "Text");
set_number("TextComponent", "scale", 2.0);
set_colour("TextComponent", "color", vec4(1.0, 1.0, 1.0, 1.0));
set_flag("TextComponent", "wrap", false);
set_flag("TextComponent", "rich", false);
set_colour("TextComponent", "outline", vec4(0.0, 0.0, 0.0, 1.0));
set_number("TextComponent", "outline_width", 0.0);
set_colour("TextComponent", "shadow", vec4(0.0, 0.0, 0.0, 0.0));
set_point("TextComponent", "shadow_offset", vec2(2.0, 2.0));
set_number("TextComponent", "shadow_softness", 1.0);

Fields

FieldScript nameKindDefaultWhat it does
Texttexttext, several linesTextWhat it says. Press Enter for a new line.
Scalescalenumber, 0.1 to 16, step 0.12Scales the size of the text.
Colorcolorcolour#ffffffColour of the text, including how see-through it is.
Alignalignone of Left, Center, RightLeftWhere the text sits horizontally inside its box.
WrapwrapcheckboxoffBreaks long lines at spaces to fit the box's width, or the Max of a Content Size Fitter that sizes the width to the text.
RichrichcheckboxoffRead the text as [b]…[/b] markup.
Visible Charactersvisible_characterssectionnoneHow many characters to reveal, like a typewriter. Off shows the whole text.
Outlineoutlinecolour#000000Colour of the outline drawn behind the letters.
Outline Widthoutline_widthnumber, 0 to 8, step 0.50How far the outline reaches, in UI units. Zero draws none.
Effects
Effect Modeeffect_modeone of Copies, DistanceFieldCopiesWhich way the outline and shadow are drawn.
Shadowshadowcolour#000000, 0% opaqueColour of the drop shadow behind the letters.
Shadow Offsetshadow_offsettwo numbers (x, y)(2, 2)How far the shadow is offset from the letters, in UI units.
Shadow Softnessshadow_softnessnumber, 0 to 16, step 0.51How far the shadow's edge is blurred, in UI units.