Camera can be zoomed with the scroll wheel. Position smoothing enabled.
This commit is contained in:
@@ -15,3 +15,8 @@ func _process(delta: float) -> void:
|
|||||||
global_position += Vector2.LEFT * 2
|
global_position += Vector2.LEFT * 2
|
||||||
if Input.is_action_pressed("MoveRight"):
|
if Input.is_action_pressed("MoveRight"):
|
||||||
global_position += Vector2.RIGHT * 2
|
global_position += Vector2.RIGHT * 2
|
||||||
|
|
||||||
|
if Input.is_action_just_released("ZoomIn"):
|
||||||
|
$SmartCamera2D.zoom += Vector2.ONE
|
||||||
|
if Input.is_action_just_released("ZoomOut"):
|
||||||
|
$SmartCamera2D.zoom -= Vector2.ONE
|
||||||
@@ -9,6 +9,7 @@ script = ExtResource("1_ig7ij")
|
|||||||
metadata/_edit_group_ = true
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
[node name="SmartCamera2D" type="Camera2D" parent="."]
|
[node name="SmartCamera2D" type="Camera2D" parent="."]
|
||||||
|
position_smoothing_enabled = true
|
||||||
script = ExtResource("2_du7i2")
|
script = ExtResource("2_du7i2")
|
||||||
target = NodePath("..")
|
target = NodePath("..")
|
||||||
metadata/_custom_type_script = "uid://xrddv2epi3ty"
|
metadata/_custom_type_script = "uid://xrddv2epi3ty"
|
||||||
|
|||||||
Reference in New Issue
Block a user