Skip to content

Animate Refactor and Fixes

Compare
Choose a tag to compare
@rogueSkib rogueSkib released this 31 Jul 04:01
· 167 commits to master since this release

This release improves timestep's animate by adding functionality and fixing small behavior differences between animate in the browser and the accelerated animate implementation in native. It also includes changes from v3.0.0-rc1 tag. See release notes from v3.0.0-rc1 for the rest of the updates.

Major changes

  • The Animator class returned by the animate API is now created once per subject and groupID pair.
  • Animators are now cached on the subject, in an __anims object, so that they only get garbage collected when the subject is garbage collected
  • The Group class returned by the animate.getGroup API has new functionality
    • pause, resume, clear, and commit functions now exist on groups of animators
  • Also exposed subject-specific and global functions for pause, resume, clear, and commit
    • animate.pauseAllAnimations
    • animate.resumeAllAnimations
    • animate.clearAllAnimations
    • animate.commitAllAnimations
    • animate.pauseSubjectAnimations
    • animate.resumeSubjectAnimations
    • animate.clearSubjectAnimations
    • animate.commitSubjectAnimations
  • Fixed a bug with commit that allowed multiple instance of Animator to fight for precedence, on native builds only
  • Fixed a bug with then that wasn't properly setting elapsed to 0 on native builds only; the behavior now matches the browser JavaScript
  • Fixed a bug where instances of Animator only inherited Emitter (PubSub) functionality in browser; they now always also work as event emitters in native
  • commit now also calls resume on paused animations so that they finish instantly

Breaking changes

  • The Group class returned by animate.getGroup no longer has a get function; it was redundant, since it returned the same thing as animate(subject, groupID)
  • Group's add function behavior changed, and should still be used primarily internally by the Animator class