added click to place tile
added basic window zoom/drag
This commit is contained in:
8
scripts/BuildingManager.gd
Normal file
8
scripts/BuildingManager.gd
Normal 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))
|
||||
Reference in New Issue
Block a user