How It Works

A Pannya UI is just a tree of nodes. Each node stores state (position, size, input flags, etc.) and can be extended with custom logic. The engine takes care of the rest.

Responsibilities

  • Nodes: Containers with fields and overridable methods.
  • Engine: Active manager that handles:
    • Layout updates
    • Input dispatch (mouse, keyboard, focus)
    • Update and draw loops

What Not To Do

  1. Don’t directly modify fields like xywidth, or height.
    • Use setters, or call invalidateAxis(Node.Axis.?) after direct modification.
  2. Don’t add nodes to a parent inside the update() method. Nodes themselves can add children to self anywhere they want.