feat: add display camera grid support
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user