Class PlacementState
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
class PlacementState extends RefCounted
Properties
placed_parent
The parent node where objects are placed during build mode.
var placed_parent: Node:
preview
The current preview object in build mode, moving with the mouse until placed.
var preview: Node:
issues
var issues: Array[String] = []
Methods
get_owner
func get_owner() -> GBOwner:
Returns
get_editor_issues
func get_editor_issues() -> Array[String]:
Returns
get_runtime_issues
func get_runtime_issues() -> Array[String]:
Returns
Events
success
Manages communication between the building system and connected objects during gameplay. Emits signals for build actions, previews, and state changes to coordinate placement. Validates readiness when the tile map is set, requiring all properties to be assigned in the same frame. Emitted when an object is successfully placed into the game world.
signal success(build_action_data: PlacementActionData)
failed
Emitted when a build action fails.
signal failed(build_action_data: PlacementActionData)
preview_changed
Emitted when the build preview instance changes.
signal preview_changed(preview: Node)
placed_parent_changed
Emitted when the parent node for placed objects changes.
signal placed_parent_changed(placed_parent: Node)
system_changed
Emitted when the connected building system changes (currently unused).
signal system_changed(system: PlacementSystem)
pre_instance_added
Emitted after the scene is instantiated but before it is added to the scene tree. Allows external code to configure the instance (set properties, attach scripts, etc.) before _ready() runs.
signal pre_instance_added(node: Node2D)