GGua REFERENCE日本語GitHub ↗
GUIDE / SEMANTIC UI TREE

Publish game UI as semantic information

A Semantic UI Tree exposes buttons, text, and input fields from a running game as information about what each control means and its current state, rather than as pixels or coordinates. A test or AI agent can find the Start Game button by name and role, operate it, and verify what changes next.

What is a Semantic UI Tree?

Instead of analyzing a rendered image, Gua represents the UI structure and meaning as one frame-consistent snapshot. A consumer can tell that a node is a visible, enabled Start Game button that supports click. This is not a dump of engine scene nodes or GameObjects; adapters translate user-facing controls into one shared protocol.

Game UIEngine adapter collectsSemantic UI TreeTests, Inspector, and AI

Information on the complete tree

FieldMeaning
screenThe current logical screen, such as title or settings.
nodesThe currently published UI nodes. parentId expresses hierarchy.
frameSequenceIncrements for every frame published by the adapter.
revisionIncrements only when the screen, nodes, state, bounds, or supported actions change.
sessionEpochIdentifies the current test-isolation session so stale snapshots are not reused after reset.
Example Semantic UI Tree snapshotjson
{
  "schemaVersion": 2,
  "screen": "title",
  "frameSequence": 42,
  "revision": 7,
  "nodes": [
    {
      "id": "title/start",
      "role": "button",
      "label": "Start Game",
      "text": "Start Game",
      "visible": true,
      "enabled": true,
      "bounds": { "x": 520, "y": 430, "w": 240, "h": 64 },
      "actions": ["click", "focus"]
    }
  ]
}

Information on each UI node

Identity and structure

id, parentId, and role describe which control this is, what it does, and where it belongs.

Human-readable content

label, text, and value describe its name, displayed text, entered value, or slider value.

Current state

visible, enabled, focus, hover, pressed, checked, selected, caret, selection, scroll, and range fields describe its current behavior.

Position and supported actions

bounds uses physical viewport pixels. actions lists the operations structurally supported by that kind of node.

What can you do with it?

Observe

Read the current screen, visible controls, text, values, selection, focus, and scroll state.

Locate by meaning

Combine id, role, name, text, parent scope, visibility, and enabled state to find a control.

Operate

Send click, focus, set_value, set_checked, select, scroll, or press_key to a matching node.

Wait and verify

Wait until Loading appears, a button becomes enabled, or a checkbox becomes checked instead of relying on a fixed sleep.

How it differs from World and game input

Semantic UI Tree

Observe and operate on-screen buttons, labels, dialogs, and input fields.

World Object Tree

Observe opted-in doors, enemies, objectives, and checkpoints outside the UI. World v1 is read-only.

Semantic Game Action

Drive gameplay intent such as jump or move.

Raw Input

Operate keyboard, pointer, and gamepad controls close to the physical device model.