Камера
This commit is contained in:
@@ -61,10 +61,6 @@ func _physics_process(delta: float) -> void:
|
||||
|
||||
if Input.is_action_just_pressed("ui_cancel"):
|
||||
change_instrument(instruments.NULL)
|
||||
if Input.is_action_just_pressed("ui_right"):
|
||||
change_instrument(selected_instrument+1)
|
||||
if Input.is_action_just_pressed("ui_left"):
|
||||
change_instrument(selected_instrument-1)
|
||||
|
||||
match selected_instrument:
|
||||
instruments.NULL:
|
||||
@@ -107,5 +103,16 @@ func change_instrument(new: instruments):
|
||||
lmb = false
|
||||
rmb = false
|
||||
|
||||
func _input(event):
|
||||
pass
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_pressed("ui_right"):
|
||||
$Camera2D.translate(Vector2.RIGHT*320*delta/$Camera2D.zoom)
|
||||
if Input.is_action_pressed("ui_left"):
|
||||
$Camera2D.translate(Vector2.LEFT*320*delta/$Camera2D.zoom)
|
||||
if Input.is_action_pressed("ui_up"):
|
||||
$Camera2D.translate(Vector2.UP*320*delta/$Camera2D.zoom)
|
||||
if Input.is_action_pressed("ui_down"):
|
||||
$Camera2D.translate(Vector2.DOWN*320*delta/$Camera2D.zoom)
|
||||
if Input.is_action_just_pressed("zoom_in"):
|
||||
$Camera2D.zoom+=Vector2.ONE*0.25
|
||||
if Input.is_action_just_pressed("zoom_out"):
|
||||
$Camera2D.zoom-=Vector2.ONE*0.25
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user