Skip to content

ManipulationState

The manipulation state holds reference to the object being manipulated and its temporary manipulated copy. It also is the source of signals regarding object manipulation like when moving or demolishing an object is started, canceled, or stopped.

signal data_changed( manipulation: ManipulationData )

The manipulation state holds reference to the object being manipulated and its temporary manipulated copy. It also is the source of signals regarding object manipulation like when moving or demolishing an object is started, canceled, or stopped.

Emitted when the active manipulation on an object changes Null means there is no manipulation currently active on the state.

signal active_manipulatable_changed( active: Manipulatable )

The manipulatable that is being hovered over

signal active_target_node_changed( active: Node )

Signal for when the currently active target node changes

signal parent_changed( node: Node2D )

When the node for performing transform adjustments to (rotate, flip, etc) during a manipulation changes

signal started( data: ManipulationData )

Emitted when a manipulation action is started

signal confirmed( data: ManipulationData )

Emitted when a manipulation action is confirmed

signal finished( data: ManipulationData )

Emitted when a manipulation action is finished

signal canceled( data: ManipulationData )

Emitted when a manipulation action is canceled

signal failed( data: ManipulationData )

Emitted when a manipulation action fails

data: ManipulationData:

Data of the active manipulation

active_manipulatable: Manipulatable:

The current targeted (hovered, etc) manipulatable component, if any

active_target_node: Node:

Compatibility alias required by older tests referencing ‘current_target’. Accepts either a Manipulatable directly or a Node/Node2D whose descendant has a Manipulatable.

parent: Node2D:

Node which is actually manipulated to effect all children including the active target node and any other nodes that need to move to be updated with the base

TODO

Replace this with a shared context between this and the building / grid targeting state

TODO

Something like the ParentContext and have the positioner assign itself to it

get_manipulator( ) -> GBOwner

Gets the active manipulator from the _owner_context GBOwnerContext.

set_targeted( p_node: Node ) -> void

Sets the target node. Either takes a regular node or a manipulatable. Will set both the active_target_node and the active_manipulatable if possible

is_targeted_movable( ) -> bool

Checks if the currently targeted manipulatable is movable.

return: bool - True if targeted object can be moved, false otherwise

validate_setup( ) -> bool

Checks if the state is ready for manipulation.

get_editor_issues( ) -> Array[String]

Returns an array of editor-time validation issues for this resource

get_runtime_issues( ) -> Array[String]

Returns an array of runtime validation issues for this resource

addons/grid_building/systems/manipulation/manipulation_state.gd


This page was auto-generated from GDScript source. Edit the source file to improve documentation.

Generated on 2025-09-07