Godot SDK Architecture - Board Docs

Architecture

Overview of the Board Godot SDK components.

Core Components

Board.input

The touch input subsystem. Receives Contact data from Board hardware and provides it to your game.

Responsibilities:

Key APIs:

This 60 fps hot path is deliberately untyped — the entries stay as raw Dictionary values to avoid per-frame allocation. For ergonomic, typed access to a single contact, wrap it with BoardContact.from_dict(c), which exposes the BoardContact.Type (FINGER/GLYPH/BLOB) and BoardContact.Phase (NONE/BEGAN/MOVED/ENDED/CANCELED/STATIONARY) enums plus the facing() -> Vector2 and is_piece() helpers. The Board.input.TYPE_* / PHASE_* int constants still exist (same values) for reading a raw contact’s type_id / phase_id directly.

There is no separate per-Contact edge signal. To detect discrete edges (tap-down / tap-up via is_touched, or a piece being lifted), keep your own previous-frame map keyed by contact_id and diff each contacts_received snapshot against it:

var _prev := {}

func _on_contacts_received(contacts: Array) -> void:
    var current := {}
    for contact in contacts:
        var id: int = contact.contact_id
        current[id] = contact
        var was := _prev.get(id)
        if was == null:
            _on_contact_appeared(contact)
        elif was.is_touched and not contact.is_touched:
            _on_piece_lifted(contact)
    for id in _prev:
        if not current.has(id):
            _on_contact_removed(_prev[id])
    _prev = current

Reference: see Touch Input for implementation details.

Board.session

Manages the current game session, players, and Profiles.

Responsibilities:

Key APIs:

Reference: see Player Management for implementation details.

Board.application

Main entry point for Board system features like the pause overlay and Profile switcher.

Responsibilities:

Key APIs:

References: see Pause Menu and Profile Switcher for implementation details.

Board.save

Handles persistent save game storage.

Responsibilities:

Key APIs:

Reference: see Save Games for implementation details.

Modules

Module Purpose
Board Application lifecycle, capability check, logging passthrough
Board.input Touch Contacts, Glyphs, input settings
Board.session Players, Profiles, sessions
Board.save Save game management
Board.avatar Cached, player-scoped avatar ImageTexture loader
Board.pause System pause overlay