-
Notifications
You must be signed in to change notification settings - Fork 0
CineCam2D class reference ‐ CineCam wiki
Lukas Schmidt edited this page May 28, 2024
·
25 revisions
Inherits: Camera2D < Node2D < CanvasItem < Node < Object
This help document refers to CineCam2D class!
Main Camera for the CineCam2D.
Features include camera shaking, camera blending to VirtualCam2D, targeting CamTarget2D and more.
Inspector
Type | Property | Hint |
---|---|---|
BlendData2D | blend_data | - |
bool | blend_pause | default: false |
CamSequence2D | current_sequence | - |
FollowMode | follow_mode | default: 0 |
bool | follow_prio_pause | default: false |
bool | follow_target_pause | default: false |
bool | sequence_pause | default: false |
float | shake_offset_duration | default: 0.0 |
Vector2 | shake_offset_intensity | default: Vector2(0, 0) |
float | shake_rotation_duration | default: 0.0 |
float | shake_rotation_intensity | default: 0.0 |
float | shake_zoom_duration | default: 0.0 |
Vector2 | shake_zoom_intensity | default: Vector2(0, 0) |
CamTarget2D | target | - |
- signal blend_completed()
Emitted when a blend is completed.
Will not be emitted for CineCam2D.FollowMode CineCam2D.TARGET_BLEND.
- signal blend_paused()
Emitted when a blend is paused.
Will not be emitted for CineCam2D.FollowMode CineCam2D.TARGET_BLEND.
- signal blend_resumed()
Emitted when a blend is resumed.
Will not be emitted for CineCam2D.FollowMode CineCam2D.TARGET_BLEND.
- signal blend_started()
Emitted when a blend is completed.
Will not be emitted for CineCam2D.FollowMode CineCam2D.TARGET_BLEND.
- signal prioritized_vcam2D_changed(vcam2D: Object, priority: int)
Emitted when any registered VirtualCam2D priority became higher than the previously highest priority VirtualCam2D.
Returns the VirtualCam2D with the now highest priority as an integer.
See VirtualCam2D.priority.
It doesn't matter, if this CineCam2D acts on it.
- signal sequence_completed()
Emitted when a sequence of blends, using CamSequence2D was completed.
- signal sequence_paused()
Emitted when a sequence of blends, using CamSequence2D was paused.
See CineCam2D.seq_pause
- signal sequence_resumed()
Emitted when a sequence of blends, using CamSequence2D was resumed.
See CineCam2D.seq_resume
- signal sequence_started()
Emitted when a sequence of blends, using CamSequence2D was started. See:
' CineCam2D.start_sequence
' CineCam2D.start_sequence_at
' CineCam2D.seq_blend_to
' CineCam2D.seq_blend_prev
' CineCam2D.seq_blend_next
- signal sequence_stopped()
Emitted when a sequence of blends, using CamSequence2D was stopped.
See CineCam2D.seq_stop
- signal shake_offset_ended()
Emitted when the camera shake, using its offset, has ended.
See CineCam2D.shake_offset
- signal shake_offset_started()
Emitted when the camera shake, using its offset, is started.
See CineCam2D.shake_offset
- signal shake_rotation_ended()
Emitted when the camera shake, using its rotation, has ended.
See CineCam2D.shake_rotation
- signal shake_rotation_started()
Emitted when the camera shake, using its rotation, has started.
See CineCam2D.shake_rotation
- signal shake_zoom_ended()
Emitted when the camera shake, using its zoom, has ended.
See CineCam2D.shake_zoom
- signal shake_zoom_started()
Emitted when the camera shake, using its zoom, has started.
See CineCam2D.shake_zoom
- enum FollowMode:
Setings for CineCam2D.follow_mode.
PRIO refers to the VirtualCam2D with the highest priority in the [SceneTree] only!
TARGET is for CamTarget2D if it is set in CineCam2D.target!
' OFF = 0,
Won't Follow anything.
' PRIO = 1,
Will constantly follow the it.
' PRIO_ONESHOT = 2,
Will follow it once.
' PRIO_BLEND = 3,
Will blend towards it once, using the data from VirtualCam2D.blend_data.
If none are given, CineCam2D.blend_data will be used.
' TARGET = 4,
Will constantly follow the target.
' TARGET_BLEND = 5
Will constantly blend towards the target.
- BlendData2D blend_data
[SET] _set_blend_data(value)
[GET] _get_blend_data()
The default blending data for this CineCam2D.
Only used as default value for blending to VirtualCam2D and only if it has no BlendData2D set.
- bool blend_pause
[SET] _set_blend_paused(value)
[GET] _is_blend_paused()
Getter / Setter for pausing the tween that is used for camera blends.
See CineCam2D.pause_blend.
- CamSequence2D current_sequence
[SET] set_current_sequence(value)
[GET] get_current_sequence()
Getter / Setter for the current CamSequence2D.
- FollowMode follow_mode
[SET] set_follow_mode(value)
[GET] get_follow_mode()
Getter / Setter for the current follow mode property.
See CineCam2D.FollowMode
- bool follow_prio_pause
[SET] set_follow_prio_paused(value)
[GET] is_follow_prio_paused()
- bool follow_target_pause
[SET] set_follow_target_paused(value)
[GET] is_follow_target_paused()
Getter / Setter for pausing the follow target feature.
See CineCam2D.TARGET, CineCam2D.TARGET_BLEND and CineCam2D.pause_follow_target.
- bool sequence_pause
[SET] _set_seq_paused(value)
[GET] _is_seq_paused()
Getter / Setter for pausing the camera sequence feature.
See CamSequence2D and CineCam2D.start_sequence.
- float shake_offset_duration
[SET] _set_shake_offset_duration(value)
[GET] _get_shake_offset_duration()
Getter / Setter for the shake offset duration.
Can be increased during a shake to increase its duration.
- Vector2 shake_offset_intensity
[SET] _set_shake_offset_intensity(value)
[GET] _get_shake_offset_intensity()
Getter / Setter for the shake offset intensity.
Can be increased during a shake to increase its intensity.
- float shake_rotation_duration
[SET] _set_shake_rotation_duration(value)
[GET] _get_shake_rotation_duration()
Getter / Setter for the shake rotation duration.
Can be increased during a shake to increase its duration.
- float shake_rotation_intensity
[SET] _set_shake_rotation_intensity(value)
[GET] _get_shake_rotation_intensity()
Getter / Setter for the shake rotation intensity.
Can be increased during a shake to increase its intensity.
- float shake_zoom_duration
[SET] _set_shake_zoom_duration(value)
[GET] _get_shake_zoom_duration()
Getter / Setter for the shake zoom duration.
Can be increased during a shake to increase its duration.
- Vector2 shake_zoom_intensity
[SET] _set_shake_zoom_intensity(value)
[GET] _get_shake_zoom_intensity()
Getter / Setter for the shake zoom intensity.
Can be increased during a shake to increase its intensity.
- CamTarget2D target
[SET] set_target(value)
[GET] get_target()
Getter / Setter for the current CamTarget2D.
- String apply_vcam2D_data(vcam2D: VirtualCam2D)
Applies all data from the given VirtualCam2D under Camera2D Section to this CineCam2D.
- void blend_to(vcam2D : VirtualCam2D, blend_data : BlendData2D)
Blends towards the given VirtualCam2D, using the given BlendData2D.
You can use CineCam2D.blend_data, VirtualCam2D.blend_data or data from any other source.
- VirtualCam2D find_vcam_by_id(id : String)
Returns the first VirtualCam2D with the given id.
Will only search registered VirtualCam2D.
See VirtualCam2D.vcam_id.
- float full_blend_duration()
Returns the full duration of the current blend.
This is either BlendData2D.blend_by_value if BlendData2D.blend_by is set to BlendData2D.DURATION
or a calculated duration, if set to BlendData2D.SPEED.
Will return -1 if the blend has not started yet.
- void init_default_blend_data()
Sets CineCam2D.blend_data to the default data.
- void pause_blend()
This will pause the currently running blend.
Will only affect CineCam2D.blend_to, CineCam2D.PRIO_BLEND or anything from CamSequence2D.
- void pause_follow_prio()
This will pause the follow priority feature.
See CineCam2D.FollowMode CineCam2D.PRIO.
- void pause_follow_target()
This will pause the follow target and target blend feature.
See CineCam2D.FollowMode CineCam2D.TARGET and CineCam2D.TARGET_BLEND.
- void prioritized_vcam()
Returns the prioritized VirtualCam2D.
- void reposition_to_vcam(vcam : VirtualCam2D)
Will teleport this Camera instantly to the given VirtualCam2D.
- void resume_blend()
Resumes the currently running blend, regardless of the current state.
Will only affect CineCam2D.blend_to, CineCam2D.PRIO_BLEND or anything from CamSequence2D.
- void resume_follow_prio()
Resumes the currently running priority blend, regardless of the current state.
See CineCam2D.FollowMode, CineCam2D.PRIO.
- void resume_follow_target()
Resumes the currently running target follow, regardless of the current state.
See CineCam2D.FollowMode, CineCam2D.TARGET and CineCam2D.TARGET_BLEND.
- void seq_blend_next()
Blends to the next VirtualCam2D in the current CineCam2D.current_sequence.
- void seq_blend_prev()
Blends to the previous VirtualCam2D in the current CineCam2D.current_sequence.
- void seq_blend_to(idx: int)
Blends to the VirtualCam2D at the given index, in the current CineCam2D.current_sequence.
- void seq_pause()
Pauses the current running sequence. Will not pause the blend, just the execution of the sequence.
- void seq_resume()
Resumes the current running sequence, regardless of the current state.
- void seq_stop()
Stops the current running sequence and resets its CamSequence2D.current_idx.
- void shake_offset(intensity : Vector2, duration : float, ease : Tween.EaseType, trans : Tween.TransitionType)
Shakes the cam.
Takes a strength and a duration in seconds.
- void shake_rotation(intensity : float, duration : float, ease : Tween.EaseType, trans : Tween.TransitionType)
Shakes the cam.
Takes a strength and a duration in seconds.
- void shake_zoom(intensity : Vector2, duration : float, ease : Tween.EaseType, trans : Tween.TransitionType)
Shakes the cam zoom.
Takes a strength and a duration in seconds.
- void start_sequence(backwards : bool = false)
Starts the sequence in CineCam2D.current_sequence.
You can set the optional bool to true, to play the sequence in reverse.
- void start_sequence_at(backwards : bool = false, index : int = 0)
Starts the sequence in CineCam2D.current_sequence at the given index.
You can set the optional bool to true, to play the sequence in reverse.
- void toggle_follow_prio()
Toggles the currently running priority blend, considering its current state.
See CineCam2D.FollowMode, CineCam2D.PRIO.
- void toggle_follow_target()
Toggles the currently running target follow, considering its current state.
See CineCam2D.FollowMode, CineCam2D.TARGET and CineCam2D.TARGET_BLEND.
- CamSequence2D get_current_sequence()
Getter for current_sequence.
- void set_current_sequence(value : CamSequence2D)
Setter for current_sequence.
- FollowMode get_follow_mode()
Getter for follow_mode.
- void set_follow_mode(value : FollowMode)
Setter for follow_mode.
- bool is_follow_prio_paused()
Getter for follow_prio_paused.
- void set_follow_prio_paused(value : bool)
Setter for follow_prio_paused.
- bool is_follow_target_paused()
Getter for follow_target_paused.
- void set_follow_target_paused(value : bool)
Setter for follow_target_paused.
- CamTarget2D get_target()
Getter for target.
- void set_target(value : CamTarget2D)
Setter for target.
My Socials
GitHub | LinkedIn | lnk.bio
Copyright(c) 2014 - present Godot Engine contributors(see AUTHORS.md), Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.
Godot Repository