Placement Classes

Placement API reference for placement classes in GridBuilding v5-0

Placement Classes

This section contains the API reference for all placement classes in the GridBuilding v5-0 plugin.

BuildActionData

Returns the preview instance from the build action if it exists

BuildingInstantiator

Instantiates a Placeable’s scene, sets its properties, and adds it to the world. Returns the instantiated Node2D if successful, otherwise null.[br][br] [code]p_placeable[/code]: [i]Placeable[/i] - The Placeable resource to instantiate[br] [code]p_preview[/code]: [i]Node2D[/i] - The preview node that holds the desired global_transform

BuildingNode

Custom display for objects being built

BuildingSettings

Script to be added to the root of any preview instance node temporarily created by the building system after non-kept scripts are stripped out. Does not override an existing script in the root.

BuildingState

Resets preview when it exits the scene tree.

BuildingSystem

Handles changes to build mode. Cleans up build state and indicators when switching out of build mode.

GridPositioner2D

Unit test helper: verify tile center calculation Returns the tile coordinate and world position for testing

GridPositionerLogic

Keyboard helper: detect rotation input from a key event and actions [param event] The keyboard input event to check [param actions] GBActions containing rotation action mappings [return] Rotation direction: 1 for clockwise, -1 for counter-clockwise, 0 for no rotation

GridPositionerUtils

Move the positioner by a specified number of tiles in a given direction

Placeable

In editor validation

PlaceableGrid

Creates views for each placeable

PlaceableInstance

Be very careful about changing these because game saves do not know if you change the string key of loaded properties.

PlaceableList

Scrollable list managing PlaceableListEntry nodes, providing selection & keyboard nav.

PlaceableListEntry

Enforces fixed height for consistent sizing when fixed_entry_height > 0

PlaceableLoader

Finds all placeables at the path and sub directories and returns them as an array

PlaceableSelectionLogic

Validates the injection depenendicies of this GBInjectable

PlaceableSelectionUI

Recursively finds all nodes of a specific type within a parent node

PlaceableSequence

Validates the sequence for runtime usage and returns any issues found. Includes sequence-level validation plus comprehensive placeable validation. Note: Individual placeable.get_runtime_issues() calls already include their editor issues, preventing duplication while ensuring complete coverage. [return] Array of validation issue descriptions, empty if no issues found

PlaceableSequenceFactory

Behavior:

  • PlaceableSequence objects are preserved as-is
  • Placeable objects are wrapped in single-item sequences
  • Null items are automatically filtered out
  • Maintains original display names and properties

PlaceableUIInteraction

Cleanup method to disconnect signals when no longer needed

PlaceableView

Enforces fixed icon size for consistent icon dimensions when [member fixed_icon_size] > 0.[br] Constrains icon to a square boundary (fixed_icon_size x fixed_icon_size) while maintaining[br] aspect ratio. The larger dimension is scaled to fit fixed_icon_size, and the smaller dimension[br] scales proportionally. Icon is centered within the bounds.[br] When disabled (0), icon sizing is not enforced and will use scene file settings.

PlacementReport

Factory: build a PlacementReport from validation issue dictionary Builds a PlacementReport using the owning GBOwner (not the owner_root Node)

PlacementRule

Returns an array of issues found during runtime validation

PlacementRuleValidationLogic

Combines base_rules that apply to all placements within a context with additional_rules that apply to specific placements[br] [br] [code]base_rules[/code] The rules that apply to all placements [br] [code]additional_rules[/code] The rules that apply to specific placements [br] [code]ignore_base[/code] Whether to ignore base rules completely and return only the additional_rules

PlacementRuleValidationLogic

Combines base_rules that apply to all placements within a context with additional_rules that apply to specific placements[br] [br] [code]base_rules[/code] The rules that apply to all placements [br] [code]additional_rules[/code] The rules that apply to specific placements [br] [code]ignore_base[/code] Whether to ignore base rules completely and return only the additional_rules

PlacementValidator

Adds rule groups to the test and returns if all were setup successfully

PreviewBuilder

Optional: Check if a preview is currently being shown.

ValidPlacementRuleSettings

Message to output when there are no tile collision indicators to check against the rule.

ValidPlacementTileRule

Checks if the tile data meets all required custom data matches

ValidPlacementTileRuleSettings

Message to output when there are no tile collision indicators to check against the rule.