Manipulatable
AUTO-GENERATED FILE — DO NOT EDIT MANUALLY
Source: components/manipulatable.gd
Version: 5.0
class_name: Manipulatable
extends: GBGameNode
Signals
manipulation_finished- Emitted when this object’s manipulation is finished (placed/moved) This allows the root object to respond to being manipulated Parameters:
- old_transform: Transform2D - The transform before manipulation
- new_transform: Transform2D - The transform after manipulation
Exports
settings- Rule settings for replacing this object in move mode, etc
root- The root of the object that should be manipulated by any actions. This manipulatable component is usually a child of the root.
Methods
resolve_gb_dependencies()is_root_hierarchy_valid()- Returns true if the configured root is an ancestor (direct or indirect) of this Manipulatable node.
create_copy()- Creates a copy of the manipulatable root with the specified name postfix. This does NOT set the parent of the root and returns the copied manipulatable.[br][br] [code]p_name_postfix[/code]: [i]String[/i] - Name postfix to append to the duplicated root’s name
get_move_rules()- Returns the tile check rules that apply when moving this object. Gets move rules from the manipulatable settings, or empty array if no settings.
is_demolishable()- Returns true if this object can be demolished based on its settings. Checks the demolishable flag in the manipulatable settings.
is_movable()- Returns true if this object can be moved based on its settings. Checks the movable flag in the manipulatable settings.
validate_setup()- Validates that the manipulatable component is properly configured. Returns true if setup is valid, false if required properties are missing.
get_issues()complete_manipulation()- SIMPLIFIED API: Completes a manipulation in a single call with proper ordering. This method handles transform application, calculates before/after states, and emits completion signals. Replaces the complex multi-step process with proper ordering guarantees.
[param p_position] Final world position for the root object [param p_rotation] Accumulated rotation in radians from ManipulationParent [param p_scale] Accumulated scale (may include negative values for flips) [param p_old_transform] Transform2D before manipulation (for signal) [param p_move_data] ManipulationData for context (optional, for future extensibility)
_on_root_exiting()_apply_manipulation_transforms()- Applies manipulation transforms (position, rotation, scale) to the root object. This method preserves flip semantics by applying rotation and scale separately, preventing Godot’s Transform2D normalization from converting negative scale to rotation.
CRITICAL: This must be called BEFORE ManipulationParent.reset() is called, because reset() clears the accumulated transforms.
[param p_position] Final world position for the root object [param p_rotation] Accumulated rotation in radians from ManipulationParent [param p_scale] Accumulated scale (may include negative values for flips)