← All scene elements
SCENE ELEMENT / 09

Text input

Editable text with submit events over MQTT.

LIVE WEB PLAYER

See it respond.

The same raylib runtime, compiled to WebAssembly. Load this example, inject MQTT messages and watch its published events.

Loading WebAssembly…
MQTT I/O
Waiting for runtime…

The browser requires a user action before the scene is loaded. Click Load demo scene first. MQTT is emulated and never leaves this page. Shaders are disabled in the web build; GPIO is hardware-only.

Editable text field for keyboard input. Submitted text is published through MQTT.

Configuration

FieldDescription
typeinput
font, font_sizeInput font
text_colorTyped text colour
bg_colorBackground colour
border_color, active_border_colorFocus border colours
border_thicknessBorder width
activeInitially focused/enabled

Copy-and-paste JSON

json
{
  "type": "input",
  "id": "visitor_name",
  "pos": [200, 500],
  "size": [700, 60],
  "font": "_decterm.ttf",
  "font_size": 28,
  "text_color": "#FFFFFFFF",
  "bg_color": "#101820FF",
  "border_color": "#4A4A4AFF",
  "active_border_color": "#FFD700FF",
  "border_thickness": 2,
  "active": true,
  "layer": 3
}

MQTT

text
ergs/rpi01/cmd/visitor_name/active       ON
ergs/rpi01/cmd/visitor_name/clear        1

Published on submit:
ergs/rpi01/input/visitor_name            Ada