added click to place tile
added basic window zoom/drag
This commit is contained in:
13
scripts/Window.gd
Normal file
13
scripts/Window.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends Camera2D
|
||||
|
||||
@export var drag_sens: float = 2.0
|
||||
|
||||
func _unhandled_input(event):
|
||||
if event is InputEventMouseButton:
|
||||
match event.button_index:
|
||||
MOUSE_BUTTON_WHEEL_DOWN:
|
||||
zoom -= Vector2(0.01, 0.01)
|
||||
MOUSE_BUTTON_WHEEL_UP:
|
||||
zoom += Vector2(0.01, 0.01)
|
||||
if event is InputEventMouseMotion and Input.is_mouse_button_pressed(MOUSE_BUTTON_MIDDLE):
|
||||
position -= event.relative * drag_sens / zoom
|
||||
Reference in New Issue
Block a user