Manipulatable

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Source File: addons/grid_building/components/manipulatable.gd

Extends: GBGameNode

Signals

  • Signal: manipulation_finished(old_transform: Transform2D, new_transform: Transform2D)

    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

Exported Properties

  • Property: settings : [ManipulatableSettings](./manipulatable-settings/) - Rule settings for replacing this object in move mode, etc

  • Property: root : Node :

    The root of the object that should be manipulated by any actions. This manipulatable component is usually a child of the root.

Private Properties

  • Property: _logger : [GBLogger](./gb-logger/) (private)

Constants

  • Constant: keep_during_preview = true

    Component node that makes a object movable, demolishable, or other system actions to be performed on the object Special marker that tells building system to keep this script during preview

Public Methods

resolve_gb_dependencies

1
resolve_gb_dependencies(p_container : GBCompositionContainer) -> void

is_root_hierarchy_valid

1
is_root_hierarchy_valid() -> bool

Returns true if the configured root is an ancestor (direct or indirect) of this Manipulatable node.


create_copy

1
create_copy(p_name_postfix : String) -> Manipulatable

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.

p_name_postfix: String - Name postfix to append to the duplicated root’s name


get_move_rules

1
get_move_rules() -> Array[TileCheckRule]

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

1
is_demolishable() -> bool

Returns true if this object can be demolished based on its settings. Checks the demolishable flag in the manipulatable settings.


is_movable

1
is_movable() -> bool

Returns true if this object can be moved based on its settings. Checks the movable flag in the manipulatable settings.


validate_setup

1
validate_setup() -> bool

Validates that the manipulatable component is properly configured. Returns true if setup is valid, false if required properties are missing.


get_issues

1
get_issues() -> Array[String]

Private Methods

_on_root_exiting

1
_on_root_exiting() -> void

Flags: private


_apply_manipulation_transforms

1
2
3
4
5
_apply_manipulation_transforms(
    p_position: Vector2,
    p_rotation: float,
    p_scale: Vector2
) -> void

Flags: private

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.

p_position Final world position for the root object p_rotation Accumulated rotation in radians from ManipulationParent p_scale Accumulated scale (may include negative values for flips)