Skip to content

Tween

Defines how PCams transition between one another. Changing the tween values for a given PCam determines how transitioning to that instance will look like.

This is a resource type that can be either used for one PCam or reused across multiple.

By default, all PCams will use a linear transition, easeInOut ease with a 1s duration.

Instant Transitions

To have an instant transitions, simply apply a value of 0 to the duration property.

Video Examples

Properties

Tween Resource

Type: PhantomCameraTween

Default: null

The resource that defines how this PCam should be transitioned to.

Can be shared across multiple PCams.

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_tween_resource(PhantomCameraTween tween_resource)

Example
gdscript
pcam.set_tween_resource(tween_resource)

Getter

PhantomCameraTween get_tween_resource()

Example
gdscript
pcam.get_tween_resource()

Tween Duration

Type: float

Default: 1

Defines how long the transition to this PCam should last in seconds.

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_tween_duration(float duration)

Example
gdscript
pcam.set_tween_duration(4.2)

Getter

PhantomCameraTween get_tween_duration()

Example
gdscript
pcam.get_tween_duration()

Tween Transition

Type: int

Default: 0

Defines the Transition type for the tweening to this PCam using the Constants.TweenTransitions enum.

Transition NameValue
LINEAR0
SINE1
QUINT2
QUART3
QUAD4
EXPO5
ELASTIC6
CUBIC7
CIRC8
BOUNCE9
BACK10

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_tween_transition(int transition_type)

Example
gdscript
pcam.set_tween_transition(2)

# Instead of applying an int directly,
# it's also possible to supply an enum value like so:
pcam.set_tween_transition(pcam.Constants.TweenTransitions.QUINT)

Getter

int get_tween_transition()

Example
gdscript
pcam.get_tween_transition()

Tween Ease

Type: int

Default: 2

Defines the Ease type for the tweening to this PCam using the Constants.TweenEases enum.

Ease TypeValue
EASE_IN0
EASE_OUT1
EASE_IN_OUT2
EASE_OUT_IN3

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_tween_ease(int ease_type)

Example
gdscript
pcam.set_tween_ease(0)

# Instead of applying an int directly,
# it's also possible to supply an enum value like so
pcam.set_tween_ease(pcam.Constants.TweenEases.EASE_IN)

Getter

int get_tween_ease()

Example
gdscript
pcam.get_tween_ease()