WIP documenting ExtendedCamera

This commit is contained in:
Rakarake 2025-06-29 03:45:23 +02:00
parent db47722881
commit 2e763728d3
3 changed files with 14 additions and 5 deletions

View file

@ -1,17 +1,23 @@
extends Camera2D extends Camera2D
class_name ExtendedCamera class_name ExtendedCamera
# TODO: look-down/up ## Camera System, General idea:
# TODO: add documentation here! ## A stack of applied cameras are kept, updated as functions are called.
## The transition is interpolated, that is most attributes
# Camera System, General idea: # TODO: look-down/up
# A stack of applied cameras are kept, updated as functions are called. # TODO: implement transition interpolation for most attributes
# The transition is interpolated, that is most attributes
## When switching cameras, this is the timeframe for all interpolation.
@export var camera_transition_time: float @export var camera_transition_time: float
## The initial camera this camera inherits it's properites from.
@export var follow_camera: ExtendedCamera @export var follow_camera: ExtendedCamera
## X: time TODO weird
@export var transition_speed_curve: Curve @export var transition_speed_curve: Curve
## Whether camera pans when looking a certain direction.
@export var look_aside_enabled: bool @export var look_aside_enabled: bool
## The x distance which the camera looks away from the player in the direction ## The x distance which the camera looks away from the player in the direction
## the player is facing ## the player is facing
@export @export

View file

@ -2701,6 +2701,7 @@ inherit_limit = true
[node name="Detatch" type="Node" parent="."] [node name="Detatch" type="Node" parent="."]
[node name="Camera" type="Camera2D" parent="Detatch" node_paths=PackedStringArray("follow_camera") groups=["affectable_camera", "flip_me"]] [node name="Camera" type="Camera2D" parent="Detatch" node_paths=PackedStringArray("follow_camera") groups=["affectable_camera", "flip_me"]]
editor_description = "The games actual camera. This camera inherits its attributes from other cameras. Some attributes for in ExtendedCamera is typically designed for this node."
process_callback = 0 process_callback = 0
limit_smoothed = true limit_smoothed = true
position_smoothing_enabled = true position_smoothing_enabled = true

View file

@ -1,5 +1,7 @@
extends ExtendedCamera extends ExtendedCamera
## A camera that automatically applies itself to actors at instanciation.
func _ready(): func _ready():
for n in get_tree().get_nodes_in_group("affectable_camera"): for n in get_tree().get_nodes_in_group("affectable_camera"):
n.apply_camera(self) n.apply_camera(self)