Skip to content

text_input

A text field for typed input — names, answers, chat messages, prompts. The phone shows the native keyboard; submission happens via the built-in submit button or the Enter key. The host receives one submit event per submission.

C# factory

WidgetDefinitions.TextInput(
id: "answer",
positionX: 0.5f, positionY: 0.5f,
placeholder: "Type your answer…",
maxLength: 80,
submitLabel: "Send"
);

Wire format

FieldTypeRequiredNotes
idstringyes
type"text_input"yes
position_x, position_ynumberno0..1 anchor.
placeholderstringnoHint text shown when empty.
max_lengthnumbernoMax characters. Default 140.
submit_labelstringnoSubmit-button label.

Events

Event typePayloadFires when
submit{ text: string }Player taps Submit or presses Enter. The field clears on submit.

Example

manager.OnInput += (player, evt) =>
{
if (evt.WidgetId == "answer" && evt.EventType == "submit")
{
var answer = evt.GetString("text");
scoreManager.ReceiveAnswer(player.Id, answer);
}
};