feat: add display camera grid support

This commit is contained in:
goose
2026-10-01 15:21:32 -04:00
parent 515cf72594
commit 929e5a394c
11 changed files with 141 additions and 10 deletions
+4 -1
View File
@@ -16,6 +16,9 @@ var map: GridMapState
var _visible_cells: Dictionary[Vector2i, bool] = {}
var _explored_cells: Dictionary[Vector2i, bool] = {}
func get_cell_rect(cell: Vector2i) -> Rect2:
return Rect2(Vector2(cell * TILE_SIZE), Vector2(TILE_SIZE))
func set_map(new_map: GridMapState) -> void:
map = new_map
queue_redraw()
@@ -47,7 +50,7 @@ func _draw() -> void:
for y in range(map.size.y):
for x in range(map.size.x):
var cell := Vector2i(x, y)
var tile_rect := Rect2(Vector2(cell * TILE_SIZE), Vector2(TILE_SIZE))
var tile_rect := get_cell_rect(cell)
var color := get_cell_render_color(cell)
if color == Color.BLACK:
draw_rect(tile_rect, Color.BLACK)