Skip to content

GBEnums

Centralized enums used across the Grid Building plugin.

Collects shared enum types (modes, actions, statuses, tile types) used by systems, UI, and tests.

enum Mode

Defines what building operation is being performed

  • OFF = 0 — Building systems are offline
  • INFO = 1 — Targeting objects for information purposes only
  • BUILD = 2 — Objects currently being placed
  • MOVE = 3 — Changing Position, Rotation, or Size of Existing Objects
  • DEMOLISH = 4 — Destroying destructible objects from the scene
enum MoveDirection

Defines what moves are allowed for purposes like AStarGrid2D pathing

  • SINGLE = 0 — Only allow moves in a single direction up, down, left, right
  • ALLOW_DIAGONOL = 1 — Allow diagonal moves that go in both X, Y axis at the same time
enum Action

Actions that can be taken within the building system

  • BUILD = 0 — Place object in location
  • MOVE = 1 — Move object to new location
  • ROTATE = 2 — Rotate object left or right
  • FLIP_H = 3 — Flip horizontally
  • FLIP_V = 4 — Flip vertically
  • DEMOLISH = 5 — Destroy a scene object
enum BuildType

Type of build operation being performed

  • SINGLE = 0 — Single click/confirmation build
  • DRAG = 1 — Continuous drag-building across multiple tiles
  • AREA = 2 — Future: Build across a defined area (e.g., fence line from point A to B)
enum Status

Status for a build / manipulation action

  • CREATED = 0 — Data for action has been created
  • STARTED = 1 — Action has been started and is running
  • FAILED = 2 — Action failed to execute. Some actions can continue to attempt to finish after initial failing.
  • FINISHED = 3 — Action has finished executing successfully,
  • CANCELED = 4 — Action was manually canceled before finishing execution
enum ProjectionMethod

Projection methods for screen to world conversion

  • UNPROJECT = 0
  • SCREEN_TO_WORLD = 1
  • CAMERA_INVERSE = 2
  • EVENT_GLOBAL = 3
  • EVENT_POS = 4
enum CenteringMode

Manual recenter targets for GridPositioner2D input actions

  • CENTER_ON_SCREEN = 0 — Center on the middle of the active viewport
  • CENTER_ON_MOUSE = 1 — Center on the current mouse cursor position
static func mode_to_string( mode: Mode ) -> String

Convert Mode enum to a stable string for diagnostics and UI

static func projection_method_to_string( method: ProjectionMethod ) -> String

Convert ProjectionMethod enum to string

addons/grid_building/gb_enums.gd


This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.