Mojo.Animation.Queue

Class Detail

Allows for running multiple animations using a shared timer, since the overhead of running multiple timers is pretty high. Mojo instantiates animation queues automatically, and applications are generally expected to work with the animation queue for the appropriate window, obtained via the Mojo.Animation.queueForElement() function.

Method Summary

  • Mojo.Animation.Queue.add(animation)
  • Mojo.Animation.Queue.remove(animation)

Method Detail

Mojo.Animation.Queue.add(animation)

Adds an 'animation' object to the queue. These objects must have an 'animate' method, which will be called repeatedly to run the animation.

Parameter

{Object} animation

Mojo.Animation.Queue.remove(animation)

Removes the given animation object from the list, so its 'animate' method will no longer be called.

Parameter

{Object} animation