added click to place tile

added basic window zoom/drag
This commit is contained in:
2024-02-03 16:30:11 -06:00
parent c6d5a8e113
commit 5b546291bf
5 changed files with 38 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
extends Node2D
@onready var world_grid = $"../world_grid"
func _unhandled_input(event):
if event is InputEventMouseButton and event.is_pressed() and event.button_index == MOUSE_BUTTON_LEFT:
prints(event.position, get_global_mouse_position(), world_grid.local_to_map(event.position), get_global_mouse_position(), world_grid.local_to_map(get_global_mouse_position()))
world_grid.set_cell(2, world_grid.local_to_map(get_global_mouse_position()), 0, Vector2i(16,2))