DragPathData
Summary
Section titled “Summary”Drag for a single drag operation between a start and end position
Properties
Section titled “Properties”start_position: Vector2
current_position: Vector2
time_held: float = 0.0
drag_distance: float = 0.0
last_tile: Vector2i
target_tile: Vector2i
next_tile: Vector2i
last_attempted_tile: Vector2i = Vector2i(999999, 999999)
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.
positioner: Node2D
targeting_state: GridTargetingState
is_dragging: bool = true
Methods
Section titled “Methods”func _init( p_positioner: Node2D, p_targeting_state: GridTargetingState )
func 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 secondsfunc 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 forp_global_position
: Vector2 - Global position to convert to tile coordinatesfunc stop( )
Source
Section titled “Source”addons/grid_building/systems/building/data/drag_path_data.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.