GGua REFERENCE日本語GitHub ↗
GODOT / UI IMPLEMENTATION

Implementing UI

You do not rewrite your UI for Gua. Build it from standard Controls, then give the root Control to the automatic collector.

Install the packaged add-on

  1. Open the latest release

    Download the Godot ZIP from the release assets and extract it.

  2. Copy addons/gua
    Expected layouttext
    your-game/
    ├─ project.godot
    └─ addons/
       └─ gua/
          ├─ gua.gdextension
          ├─ gua_auto_adapter.gd
          ├─ plugin.cfg
          └─ bin/
  3. Open the project in Godot

    Check the Godot output to confirm that the GDExtension loaded successfully.

Attach it from GDScript

  1. Preload the adapter explicitly

    Explicit preload avoids depending on class_name registration order.

    main.gdgdscript
    extends Control
    
    const GuaAutoAdapterScript := preload(
      "res://addons/gua/gua_auto_adapter.gd"
    )
    
    var ui := GuaAutoAdapterScript.new()
    
    func _ready() -> void:
      ui.attach(self)
      ui.update("title")
      ui.start_inspector_bridge(8765)
    
    func _process(_delta: float) -> void:
      ui.update("title")
  2. Pin IDs only where stability matters

    The default ID comes from the NodePath. Use metadata when an ID must survive scene-tree refactoring.

    Stable and sensitive fieldsgdscript
    name_input.set_meta("gua_id", "login-user")
    password_input.set_meta("gua_id", "login-password")
    password_input.set_meta("gua_sensitive", true)

Commonly observed Controls

Inputs

LineEdit, TextEdit, CheckBox, OptionButton, and ItemList

State

Focus, selection, value, scrolling, ranges, visibility, and enabled state