Introduced FreeCameraComponent
A new component, FreeCameraComponent, has been added to the project. This component allows for more flexible camera control including key movement, edge scrolling, mouse dragging and zooming. The camera's speed, margin and zoom limits can be adjusted as needed. The old Camera2D node in the glowing.tscn file has been removed and replaced with this new component in test_level.tscn.
This commit is contained in:
parent
1d04d27969
commit
cec9227b67
4 changed files with 121 additions and 3 deletions
11
components/FreeCameraComponent.tscn
Normal file
11
components/FreeCameraComponent.tscn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://rnfx7djn5qik"]
|
||||
|
||||
[ext_resource type="Script" path="res://components/scripts/free_camera_component.gd" id="1_isqof"]
|
||||
|
||||
[node name="FreeCameraComponent" type="Node2D"]
|
||||
|
||||
[node name="GameCamera" type="Camera2D" parent="."]
|
||||
script = ExtResource("1_isqof")
|
||||
zoom_out_limit = 10
|
||||
camera_speed = 400
|
||||
camera_margin = 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue