Skip to content

UI Coordinator

Managed by UIStateManager

In v2.0, you rarely need to call UICoordinator directly. The UIStateManager automatically calls it behind the scenes whenever you open or close panels to ensure they are arranged perfectly side-by-side.

How it Works

UIStateManager assigns a ui_role metadata to panels (e.g., "player", "container"). UICoordinator then maps these roles to specific layout modes to calculate anchor presets.

UIStateManager Role UICoordinator Layout Mode Behavior
"player" "primary" Anchors the UI to the right side of the screen.
"container" "secondary" Anchors to the left side if a player UI is open.
"default" "centered" Places the UI dead center in the middle of the screen.

Manual API (For Custom UI Systems)

If you are building your own UI manager and need to position panels manually, you can use:

# Arrange an array of open panels automatically
UICoordinator.arrange_panels(panels_array)

# Position a specific panel manually
UICoordinator.position_panel(panel_control, "primary") # "primary", "secondary", "primary_centered", "centered"