Skip to content

Components

WorldText

A line of text drawn in the room rather than on a screen: a damage number, a name tag, an interaction prompt. Placed at a point from the node's own position plus an offset, not inside a box. Holds a fixed size on screen as the camera zooms.

On this page

Add it

+ Add node → World Text creates a node with it already on. Already have a node for it? Add component → WorldTextComponent.

From a script

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

rgs
set_text("WorldTextComponent", "text", "Text");
set_number("WorldTextComponent", "scale", 1.0);
set_colour("WorldTextComponent", "color", vec4(1.0, 1.0, 1.0, 1.0));
set_point("WorldTextComponent", "offset", vec2(0.0, -24.0));
set_flag("WorldTextComponent", "pixel_size", true);
set_flag("WorldTextComponent", "unshaded", false);
set_colour("WorldTextComponent", "outline", vec4(0.0, 0.0, 0.0, 1.0));
set_number("WorldTextComponent", "outline_width", 1.0);
set_colour("WorldTextComponent", "shadow", vec4(0.0, 0.0, 0.0, 0.0));
set_point("WorldTextComponent", "shadow_offset", vec2(1.0, 1.0));
set_number("WorldTextComponent", "shadow_softness", 0.0);

Fields

FieldScript nameKindDefaultWhat it does
Texttexttext, several linesTextWhat it says. Press Enter for a new line.
Scalescalenumber, 0.1 to 16, step 0.11Scales the size of the text.
Colorcolorcolour#ffffffColour of the text, including how see-through it is.
Alignalignone of Left, Center, RightCenterWhich edge of the text lines up with where it's placed.
Offsetoffsettwo numbers (x, y)(0, -24)How far from the node's own position it sits, in world units.
Pixel Sizepixel_sizecheckboxonHold a fixed size as the camera zooms.
Sort Layerlayernumber1Sort layer it draws on, over the sprite it labels.
FontfontassetnoneFont to draw with; leave it unset to use the UI font.
UnshadedunshadedcheckboxoffKeep its colour under the room's lights, as a sprite's Unshaded does: a number in a dark crypt stays readable.
Effects
Effect Modeeffect_modeone of Copies, DistanceFieldCopiesCopies draws the outline and shadow as offset copies of the words, in any font; Distance Field draws them in one pass from the font's distance field, sharp at any zoom, and is the one that softens a shadow.
Outlineoutlinecolour#000000Colour of the outline drawn behind the letters. Fully transparent draws no outline.
Outline Widthoutline_widthnumber, 0 to 8, step 0.51How far the outline reaches, in world units. Zero draws none.
Shadowshadowcolour#000000, 0% opaqueColour of the drop shadow behind the letters. Fully transparent draws no shadow.
Shadow Offsetshadow_offsettwo numbers (x, y)(1, 1)How far the shadow is offset from the letters, in world units.
Shadow Softnessshadow_softnessnumber, 0 to 16, step 0.50How far the shadow's edge is blurred, in world units.