A simple implementation of a Node for the abstract class AStar2DGrid, that can be used to implement pathfinding.
- Example 01 - Simple Movement
- Example 02 - Scenery obstacles with point disable
- AStar2DGridNode
AStarGrid2D grid
[ default: AStarGrid2D.new() ] [getter, setter]Vector2i grid_size
[ default: Vector2i(32, 32) ] [getter, setter]Vector2 cell_size
[ default: Vector2(16, 16) ] [getter, setter]Array[Vector2i] disabled_points
[ default: [ ] ] [getter, setter]
bool enable_debug
[ default: true ] [ getter, setter ]bool debug_editor_only
[ default: true ] [ getter, setter ]float debug_point_size
[ default: 2.0 ] [ getter, setter ]float debug_point_border_size
[ default: 0.5 ] [ getter, setter ]Color enabled_point_fill_color
[ default: Color.SALMON ] [ getter, setter ]Color enabled_point_border_color
[ default: Color.WHITE ] [ getter, setter ]Color disabled_point_fill_color
[ default: Color.SLATE_GRAY ] [ getter, setter ]Color disabled_point_border_color
[ default: Color.WHITE ] [ getter, setter ]
Array calculate_point_path(from: Vector2, to: Vector2)
Array calculate_point_path_by_id(from_id: Vector2i, to_id: Vector2i)
Array calculate_id_path(from: Vector2, to: Vector2)
Array calculate_id_path_by_id(from_id: Vector2i, to_id: Vector2i)
void disable_point(id: Vector2i)
void enable_point(id: Vector2i)
void disable_points(ids: Array[Vector2i])
void enable_points(ids: Array[Vector2i])
Vector2i get_nearest_id(pos: Vector2)
Vector2i get_nearest_real_id(pos: Vector2)
Array[Vector2i] get_id_list_inside_rect(rect: Rect2, margin)
Array[Vector2i] get_id_list_inside_circle(origin: Vector2, radius: float, margin: float = 0.0)
Rect2 get_local_rect()
Rect2 get_global_rect()
Vector2 get_point_position