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( parent: ManipulationParent )

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:

Internal backing field for active_target_node property

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

parent: ManipulationParent:

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 The ManipulationParent node responsible for coordinating transforms during manipulation. Enforces ManipulationParent class to ensure proper transform coordination methods are available. This ensures indicators rotate/flip with manipulated objects via transform inheritance.

func _init( p_owner_context: GBOwnerContext ) -> void
func get_manipulator( ) -> GBOwner

Gets the active manipulator from the _owner_context GBOwnerContext.

func 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

func is_targeted_movable( ) -> bool

Checks if the currently targeted manipulatable is movable.

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

func validate_setup( ) -> bool

Checks if the state is ready for manipulation.

func _on_data_status_changed( p_status: GBEnums.Status )

Private handler for status changes in manipulation data. Emits specific signals for each status so other nodes like UI can respond.

p_status: GBEnums.Status - New status of the manipulation data

func get_editor_issues( ) -> Array[String]

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

func get_runtime_issues( ) -> Array[String]

Returns an array of runtime validation issues for this resource

addons/grid_building/systems/manipulation/manipulation_state.gd


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