KeyframeGroup

A keyframe group handles the transition from one keyframe to another keyframe.

Constructors

this
this(float duration, TweenMode mode, EasingFunc f)

Creates a new keyframe group.

Members

Functions

append
void append(Keyframe[] items)

Appends the keyframe to the animation.

appendEvenly
void appendEvenly(float[] values)

A helper function for appending many keyframes evenly to the animation.

clear
void clear()

Removes all keyframes from the animation.

elapsedTime
float elapsedTime()

Returns the current animation time.

elapsedTime
float elapsedTime(float time)

Sets the current animation time to a specific value and returns the current animation value.

hasFinished
bool hasFinished()

Returns true if the animation has finished. This function makes sense when the tween mode is set to bomb.

hasStarted
bool hasStarted()

Returns true if the animation has started. This function makes sense when the tween mode is set to bomb.

length
size_t length()

Returns the keyframe count of the animation.

now
float now()

Returns the current animation value. The value is between the current keyframe and the next keyframe.

opDollar
size_t opDollar()

Returns the keyframe count of the animation.

opIndex
Keyframe opIndex(size_t index)

Returns the keyframe at the given index.

opIndexAssign
void opIndexAssign(Keyframe value, size_t index)

Sets the keyframe at the given index to the given keyframe.

progress
float progress()

Returns the current animation progress. The progress is between 0.0 and 1.0.

progress
void progress(float value)

Sets the current animation progress to a specific value. The progress is between 0.0 and 1.0.

remove
void remove(size_t index)

Removes the keyframe at the given index.

reset
void reset()

Resets the current animation time.

update
float update(float dt)

Updates the current animation time by the given delta time and returns the current animation value.

Variables

duration
float duration;

The duration of the animation

f
EasingFunc f;

The function used to ease from one keyframe to another keyframe.

isYoyoing
bool isYoyoing;

Controls if the delta time given to the update function is reversed.

keys
Keyframe[] keys;

The keyframes of the animation.

mode
TweenMode mode;

The mode of the animation.

time
float time;

The current time of the animation.

Meta