UIInputText
Editable text field with caret, selection, and keyboard input handling.
Create in the Editor
- Ensure there is a
UIControllerin the scene. - Create a GameObject and add
UIRect. - Add the
UIInputTextcomponent.
How to Use
- Get the component with
myObject.findComponent(UIInputText.class). - Read and write the component properties to control behavior.
- Test input or layout in Play mode.
Java Example
SpatialObject myObject = /* your object */;
UIInputText comp = myObject.findComponent(UIInputText.class);
if (comp != null) {
// set the color value:
comp.color = new Color(255, 255, 255, 255);
// read the color value:
Color colorValue = comp.color;
// set the text value:
comp.text = "value";
// read the text value:
String textValue = comp.text;
// set the textSize value:
comp.textSize = 1f;
// read the textSize value:
float textSizeValue = comp.textSize;
}