Class: cuiAnimation

cuiAnimation

Animations allow to animate (i.e. interpolate) numbers specified by keyframes. (See cuiKeyframe.)

new cuiAnimation()

Create a new cuiAnimation.
Source:

Methods

animateValues() → {number[]}

Compute an array of interpolated values based on the keyframes and the current time. Returns the values array of the 0th keyframe if the animation hasn't started yet and the values array of the last keyframe if it has finished playing. This makes it possible to use animateValues even after the animation has stopped. (See cuiKeyframe.)
Source:
Returns:
An array of interpolated values.
Type
number[]

isPlaying() → {boolean}

Determine whether the animation is currently playing.
Source:
Returns:
True if the animation is currently playing, false otherwise.
Type
boolean

play(keyframes, stretch, isLooping)

Play an animation.
Parameters:
Name Type Description
keyframes cuiKeyframe[] An array of keyframe objects. (Object initialization with something like var keys = [{time : ..., in : ..., out : ..., values : [..., ...]}, {...}, ...]; is encouraged.) (See cuiKeyframe.)
stretch number A scale factor for the times in the keyframes; one way of usage: start designing keyframe times with stretch = 1 and adjust the overall timing at the end by adjusting stretch; another way of usage: define all times of keyframes between 0 and 1 (as in CSS transitions) and then set stretch to the length of the animation in seconds.
isLooping boolean Whether to repeat the animation endlessly.
Source:

stopLooping()

Stop looping the animation.
Source: