Skip to content

Components

TextEntry

A single line of editable text: a save name, a code, a search box. It shows a placeholder while empty, Mode limits what it accepts, and it takes typing only while focused, which raises a phone's keyboard. Goes under a Canvas.

On this page

Add it

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

From a script

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

rgs
set_text("TextEntryComponent", "action", "");
set_text("TextEntryComponent", "text", "");
set_text("TextEntryComponent", "placeholder", "Enter text");
set_flag("TextEntryComponent", "disabled", false);
set_number("TextEntryComponent", "padding", 6.0);
set_number("TextEntryComponent", "scale", 2.0);
set_number("TextEntryComponent", "caret_width", 2.0);
set_colour("TextEntryComponent", "normal", vec4(0.1, 0.1, 0.13, 1.0));
set_colour("TextEntryComponent", "hovered", vec4(0.14, 0.14, 0.18, 1.0));
set_colour("TextEntryComponent", "pressed", vec4(0.08, 0.08, 0.1, 1.0));
set_colour("TextEntryComponent", "foreground", vec4(0.9, 0.9, 0.94, 1.0));
set_colour("TextEntryComponent", "hint", vec4(0.55, 0.55, 0.6, 1.0));
set_colour("TextEntryComponent", "selection", vec4(0.25, 0.4, 0.7, 1.0));

Fields

FieldScript nameKindDefaultWhat it does
ActionactiontextemptyReported when Enter is pressed in this field, and names its text for a script.
TexttexttextemptyWhat is in the field.
PlaceholderplaceholdertextEnter textShown while the field is empty.
Max Lengthmax_lengthnumber, at least 000 is no limit.
Modemodeone of Text, Integer, Decimal, PasswordTextWhat the field accepts.
DisableddisabledcheckboxoffWhether it takes input at all.
Paddingpaddingnumber, at least 06 pxInset of the text from the edge of the field, in UI units.
Scalescalenumber, 0.1 to 16, step 0.12Scales the size of the text you type, the same way Scale does on a Text component.
Caret Widthcaret_widthnumber, at least 12 pxWidth of the caret bar, in UI units.
Colors
Normalnormalcolour#1a1a21Tint when idle.
Hoveredhoveredcolour#24242eTint under the pointer, or when focused.
Pressedpressedcolour#14141aTint while held.
Foregroundforegroundcolour#e6e6f0Colour of the text itself.
Hinthintcolour#8c8c99Colour of the placeholder.
Selectionselectioncolour#4066b3Colour of the selection highlight, drawn behind the selected text.