Basic guest list
This commit is contained in:
36
scenes/camera/camera_controller.gd
Normal file
36
scenes/camera/camera_controller.gd
Normal file
@@ -0,0 +1,36 @@
|
||||
extends Camera2D
|
||||
|
||||
|
||||
@export_range(0.0, 100) var pan_speed: float = 1.0
|
||||
|
||||
var should_move_right = false
|
||||
var should_move_left = false
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if should_move_right:
|
||||
position.x += pan_speed
|
||||
if should_move_left:
|
||||
position.x -= pan_speed
|
||||
|
||||
|
||||
func _on_pan_right_mouse_entered() -> void:
|
||||
should_move_right = true
|
||||
|
||||
|
||||
func _on_pan_right_mouse_exited() -> void:
|
||||
should_move_right = false
|
||||
|
||||
|
||||
func _on_pan_left_mouse_entered() -> void:
|
||||
should_move_left = true
|
||||
|
||||
|
||||
func _on_pan_left_mouse_exited() -> void:
|
||||
should_move_left = false
|
||||
1
scenes/camera/camera_controller.gd.uid
Normal file
1
scenes/camera/camera_controller.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cgctwciolfqe5
|
||||
Reference in New Issue
Block a user