DragPathData
Summary
Section titled “Summary”Drag for a single drag operation between a start and end position
Properties
Section titled “Properties”start_position: Vector2current_position: Vector2time_held: float = 0.0drag_distance: float = 0.0last_tile: Vector2itarget_tile: Vector2inext_tile: Vector2ilast_attempted_tile: Vector2i = Vector2i(999999, 999999)build_requests: int = 0Number 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: Node2Dtargeting_state: GridTargetingStateis_dragging: bool = true
Methods
Section titled “Methods”func _init( p_positioner: Node2D, p_targeting_state: GridTargetingState )func update( delta: float ) -> voidUpdates 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 ) -> Vector2iConverts 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.