DragPathData

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Drag for a single drag operation between a start and end position

Source File: addons/grid_building/systems/building/data/drag_path_data.gd

Properties

  • Property: start_position: Vector2

  • Property: current_position: Vector2

  • Property: time_held: float = 0.0

  • Property: drag_distance: float = 0.0

  • Property: last_tile: Vector2i

  • Property: target_tile: Vector2i

  • Property: next_tile: Vector2i

  • Property: last_attempted_tile: Vector2i = Vector2i(999999, 999999)

  • Property: build_requests: int = 0

    Number of build requests made during this drag session. Incremented each time DragManager calls BuildingSystem.try_build(). Useful for monitoring drag-build behavior and verifying request throttling.

  • Property: positioner: Node2D

  • Property: targeting_state: [GridTargetingState](./grid-targeting-state/)

  • Property: is_dragging: bool = true

Public Methods

update

1
update(delta: float) -> void

Updates the drag data with current frame delta time. Recalculates distance, time held, and target tile position for this drag operation.

delta: float - Time elapsed since last frame in seconds


get_tile_at_node_2d

1
2
3
4
get_tile_at_node_2d(
    p_map: TileMapLayer,
    p_global_position: Vector2
) -> Vector2i

Converts global position to tile coordinates on the specified map. Helper function for converting world positions to tilemap coordinates.

p_map: TileMapLayer - The tilemap layer to convert coordinates for

p_global_position: Vector2 - Global position to convert to tile coordinates


stop

1
stop()

Private Methods

_init

1
2
3
4
_init(
    p_positioner: Node2D,
    p_targeting_state: GridTargetingState
)

Flags: private