Skip to content

Class

ModeSwitchBar

Generated GDScript class reference for GridPlacement.ModeSwitchBar.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Clickable Info/Build/Move/Demolish mode-switch bar shared by every demo. One row of icon-only toggle buttons on a shared background panel, mirroring number keys 1-4: pressing a mode's button enters that mode, and pressing the active mode's button toggles back to OFF, exactly like the keys. Key-driven changes reflect back onto the buttons via [signal ModeState.mode_changed], so the bar always shows the live mode. Hovering a button names the mode, its key, and what it does. Build goes through [method GridPlacementHost.enter_place_router_for_session] (the key-2 path) when a host is bound; a host that rejects the session leaves the mode unchanged (the bar re-renders the real mode) instead of faking PLACE. With no host bound, Build sets PLACE directly. Lives in the shared demo HUD bottom-center row, so all 2D demos and the 3D demo get it.

Source: addons/grid_placement/ui/mode/mode_switch_bar.gd

Syntax

class ModeSwitchBar extends PlacementControl

Members

NameKindSummary
icon_infoProperty
icon_buildProperty
icon_moveProperty
icon_demolishProperty
mode_buttonMethod
resolve_placement_dependenciesMethod
resolve_placement_runtimeMethod