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
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Action | action | text | empty | Reported when Enter is pressed in this field, and names its text for a script. |
| Text | text | text | empty | What is in the field. |
| Placeholder | placeholder | text | Enter text | Shown while the field is empty. |
| Max Length | max_length | number, at least 0 | 0 | 0 is no limit. |
| Mode | mode | one of Text, Integer, Decimal, Password | Text | What the field accepts. |
| Disabled | disabled | checkbox | off | Whether it takes input at all. |
| Padding | padding | number, at least 0 | 6 px | Inset of the text from the edge of the field, in UI units. |
| Scale | scale | number, 0.1 to 16, step 0.1 | 2 | Scales the size of the text you type, the same way Scale does on a Text component. |
| Caret Width | caret_width | number, at least 1 | 2 px | Width of the caret bar, in UI units. |
| Colors | ||||
| Normal | normal | colour | #1a1a21 | Tint when idle. |
| Hovered | hovered | colour | #24242e | Tint under the pointer, or when focused. |
| Pressed | pressed | colour | #14141a | Tint while held. |
| Foreground | foreground | colour | #e6e6f0 | Colour of the text itself. |
| Hint | hint | colour | #8c8c99 | Colour of the placeholder. |
| Selection | selection | colour | #4066b3 | Colour of the selection highlight, drawn behind the selected text. |