← All scene elements
SCENE ELEMENT / 11

Chat

A rolling, colour-aware message buffer.

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.

Scrollable multiline message buffer. Each update appends a new line and older lines are discarded when max_lines is exceeded. It inherits text/font styling.

Configuration

FieldDescription
typechat
font, size, colorText styling
max_linesMaximum retained lines
line_spacingLine spacing
valueOptional initial content

Copy-and-paste JSON

json
{
  "type": "chat",
  "id": "event_log",
  "pos": [80, 120],
  "size": 26,
  "font": "_decterm.ttf",
  "color": "#9CFFB5FF",
  "max_lines": 12,
  "line_spacing": 1.2,
  "value": "SYSTEM READY",
  "layer": 2
}

MQTT

text
ergs/rpi01/update/event_log              Door opened
ergs/rpi01/cmd/event_log/clear           1
ergs/rpi01/cmd/event_log/maxlines        20
ergs/rpi01/cmd/event_log/color           #FFD700