AnimationManager
Usage
const deckAnimation = new DeckAnimation({...})
const keplerAnimation = new KeplerAnimation({...})
const animationManager = new AnimationManager({
animations: [deckAnimation, keplerAnimation]
});
Constructor
new AnimationManager({timeline, animations});
Parameters:
timeline (Object, Optional)
Override the lumagl timeline object used in animationManager.
animations (Animation[], Optional)
An initial set of animations. They can also be attached later with attachAnimation. Or just update animation keyframes, see setKeyframes.
Methods
attachAnimation(animation)
Attaches an animation to the timeline and draw cycle.
Parameters:
animation(Animation)
getAnimation(animationId)
Return attached animation by id.
setKeyframes(animationId, params)
Updates keyframe values for an attached animation.
Parameters:
-
animationId(string) - same asanimation.id -
params(object) - same type as provided during animation construction.
getKeyframes(animationId)
Parameters:
animationId(string) - same asanimation.id
Returns:
Object - same type as provided during animation construction.
draw()
Draws the current frame for all attached animations.