Class: AnimationManager

animationmanager~AnimationManager(stylesheetLink)

The manager for all module:animationmanager~CCSSAnimationBase animations.

Constructor

new AnimationManager(stylesheetLink)

Start building module:animationmanager~CCSSAnimationBases from a given stylesheet. Factors in @import statements.
Parameters:
Name Type Description
stylesheetLink string HREF to the stylesheet.
Source:

Members

animations

All possible animations, in a hierarchy tree.
Source:

animationsToClean :Array:.<CCSSAnimationBase:>

A list of animations done playing, but that we still need CSS properties to rest at. If we stop automatically, that can screw up some other animations that are dependent on the one we've stopped. Called by module:animationmanager~AnimationManager#cleanAnimsOfName and module:animationmanager~AnimationManager#cleanAllAnims.
Type:
  • Array:.<CCSSAnimationBase:>
Source:

currAnimations :Array:.<CCSSAnimationBase:>

A list of the animations currently playing.
Type:
  • Array:.<CCSSAnimationBase:>
Source:

onFinishes :Object:.<string:, function()>

Callbacks for when an animation of a given name finishes.
Type:
  • Object:.<string:, function()>
Source:

stylesheet

The stylesheet that this animation manager represents.
Source:

Methods

cleanAllAnims()

Clean every animation (i.e., stop them all from playing)
Source:

cleanAnimsOfName(name)

Clean all animations of a given name (i.e., stop them from playing)
Parameters:
Name Type Description
name string Name of animation to stop.
Source:

evaluateMainSheet()

Evaluate the main stylesheet.
Source:

evaluateSheet(stylesheet)

Recursively find stylesheets to read with @import statements included.
Parameters:
Name Type Description
stylesheet StyleSheet The stylesheet to read.
Source:
To Do:
  • Make this a compilation process instead of real-time.

frameUpdate(time)

Run every frame to update module:animationmanager~CCSSAnimationBases. Called by MicrogameJam#update.
Parameters:
Name Type Description
time number The time in ms.
Source:
To Do:
  • I might update to using the Javascript Web Animation API if current timings prove to be too inconsistent: https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API

playKeyframedAnimation(name, options)

Play a module:animationmanager~CCSSGlobalAnimation as long as it starts with the name CCSSGLOBAL, and it has been evaluated by this animation manager.
Parameters:
Name Type Description
name string the name of the animation.
options Object:.<string:, *:> A set of options to load into this animation.
Source:

stopAllAnimations()

Stop all animations from playing.
Source:

stopAllKeyframedAnimationOf(name)

Prepare a set of animations to be cleaned, then clean them using module:animationmanager~AnimationManager#cleanAnimsOfName.
Parameters:
Name Type Description
name string Animation to stop playing.
Source: