class_name TileMarker extends Node2D ## Marks the tile under the mouse, drawn by `art`: one way when the figure ## can reach it, another when it is too far away. var tile := Vector2i(-1, -1) var in_reach := false var art: Art ## Moves the mark to `new_tile`. Redraws only when something changed. func show_tile(new_tile: Vector2i, reachable: bool) -> void: if new_tile == tile and reachable == in_reach: return tile = new_tile in_reach = reachable queue_redraw() func _draw() -> void: if art == null: return var size := GridMotion.TILE_SIZE art.draw(self, Art.MARKER, Rect2(Vector2(tile) * size, Vector2(size, size)), {"reachable": in_reach})