PackageDescription: Animations


Animations

Last published: July 7, 2007 by 'michael'

Defines 9 Classes
Extends 9 Classes


This package contains an implementation of basic Animation mechanisms like those found in Cocoa, Flash MX, Apollo and various Web 2.0 frameworks such as Mootools, Scriptaculous.

Each Animation can be run with different kinds of transitions, such as Linear, Quadratic, Sinenoidal, Circular, Bouncing, etc. Eased Tweening is based off of Robert Penners algorithms, http://www.robertpenner.com/easing/

Animations are easy to set up and combine together to run in sequential order or run in parallel.

[:progress | Transcript cr; show: progress printString] asAnimation
duration: 2000;
fps: 50;
play.

Animations can be run in the active process or put in to a background process and controlled with #start and #stop, eg:

| myAnimation |
myAnimation := [:progress | ] asAnimation.
myAnimation start.
(Delay forMilliseconds: 25) wait.
myAnimation stop.

Animations can be combined sequentially using , or Animations.AnimationSequence, eg:

([:progress | Transcript cr; show: 'a: ', progress printString] asAnimation, [:progress | Transcript cr; show: 'b: ', progress printString] asAnimation) play

And Animations can be run in parallel using an Animations.AnimationSet, eg:

Animations.AnimationSet new
add: [:progress | Transcript cr; show: 'a: ', progress printString] asAnimation;
add: [:progress | Transcript cr; show: 'b: ', progress printString] asAnimation;
play.

Combinations of Sets and Sequences can be used arbitrarily.

Animations can also be reversed to 'undo' their effect. Calling #reverse gives you a copy of the animation that will run in reverse, eg:

[:progress | Transcript cr; show: 'a: ', progress printString] asAnimation reverse play

Animations can also be looped indefinitely with the #loop API