Realot StudioDocs
Components

TextInput

Realot Studio TextInput component reference: fields, script API, behavior and examples.

View as Markdownllms.txt
ScopeThis page documents the TextInput component in Realot Studio. Runtime fields are serialized scene data; the Script API section lists only members intentionally exposed to game scripts.
Where to find it in the editorTop UI → Message Input, or Inspector → Add Component → Text Input.

#What it does

Interactive text input control driven by the runtime UI system.

Component setup & editor toolsTextInput creates an editable text-entry control and is typically created from GameObject → UI or the Inspector Add Component picker.

#How to add and use TextInput

Editor path: Select the target entity in the Hierarchy (left side) → look at the Inspector (right side) → click Add Component at the bottom of the Inspector → search for TextInput → click the component row. The Add Component picker is a centered modal with a search box; it only lists components not already attached.

For components with a dedicated editor tool, the tool is opened or activated from the location described below. Do not assume that adding the component alone activates its editor; some systems require a separate window, panel, or viewport tool.

#Component setup & editor tools

  • GameObject → UI → Message Input creates a TextInput entity. You can also select an entity → Inspector → Add Component → Text Input.

#What you should see after adding it

The component appears as its own section in the Inspector. Its serialized settings are listed in the Component data table below. If a field is conditional, it appears only when the relevant mode/type is selected. If a field is a runtime state field (for example grounded or resolved velocity), treat it as read-only diagnostic state unless the API reference explicitly documents it as writable.

#How to read the settings

For every setting below, the documentation distinguishes type, default, meaning, and tuning direction where behavior is known. When a value represents a direction, use the engine's coordinate convention documented in Coordinate system; do not substitute Unity/Godot conventions.

#Component data

FieldTypePurposeDefault
valuestringCurrent text.
placeholderstringPlaceholder text.Type a message...
maxLengthnumberMaximum characters.200
fontSizenumberFont size.18
fontFamilystringFont family.Arial
textColorhex color stringText color.#111111
placeholderColorhex color stringPlaceholder color.#999999
backgroundColorhex color stringBackground.#ffffff
borderColorhex color stringBorder.#888888
borderWidthnumberBorder width.2
cornerRadiusnumberCorner radius.8
widthnumberControl width.260
heightnumberControl height.40
paddingnumberHorizontal/vertical padding.10
clearOnSubmitbooleanempty the field automatically after Enter — typical chat-box behaviortrue
focusedbooleanLive state — see the file header for why these live here rather than in TextInputSystem's private state.false
justSubmittedbooleanone-frame pulse: true for exactly one frame after Enter is pressedfalse

#Tuning behavior

These are the practical direction-of-change rules for the most important controls on this component.

SettingWhat changing it does
maxLengthHard cap on typed characters.
width / heightChanges the visual input box size.
borderWidthHigher = thicker border.
paddingHigher moves the text farther from the box edge.

#Script API

MemberKindDescription
backgroundColorProperty (read/write)Background color.
borderColorProperty (read/write)Border color.
borderWidthProperty (read/write)Border width.
clear()MethodThe `this.textInput` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
clearOnSubmitProperty (read/write)The `this.textInput` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
cornerRadiusProperty (read/write)Corner radius.
focusedProperty (read-only)The `this.textInput` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
fontFamilyProperty (read/write)Font family.
fontSizeProperty (read/write)Font size.
heightProperty (read/write)Control height.
justSubmittedProperty (read-only)The `this.textInput` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
maxLengthProperty (read/write)Character cap.
paddingProperty (read/write)Padding.
placeholderProperty (read/write)Placeholder.
placeholderColorProperty (read/write)Placeholder color.
textColorProperty (read/write)Text color.
valueProperty (read/write)The `this.textInput` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
widthProperty (read/write)Control width.

#Examples

js
if (this.textInput.justSubmitted) {
  sendMessage("Chat", "message", this.textInput.value);
  this.textInput.clear();
}
Need the full workflow?Components: complete workflow covers adding, configuring, testing, combining, and removing components.