Class Animator

Object
   |
   +--Animator

class Animator


Note: the classname "Animator" is a bit of a misnomer. It's more of a three-state-button-o-matic. Might be renamed at a later date (runeh)
Handle a two or three state button with support for animaton. The button has an initial state, an active state (possibly animated), and optionally a final state. An example is a "connect" button. It starts out passive. When pressed it animates a progress indicator, and when connected, it turns green. The initial state is always the first in the image, that is, positioned at 0px from the top. Hence, one does not need to pass an argument to the constructor to set up the initial state. The animation is configured by passing a dictionary with settings. The dictionary contains the following:
id (required)
The id of the element to operate as a string
delta (required)
The height of a frame of animation in pixels as an int
iterations (required)
The number of frames in the active state as in int
active (optional)
The offset of the first active state frame in the image in pixels as an int. Default: 0
final (optional)
The offset of the final state frame in the image in pixels as an int. Default: 0
x_position (optional)
The vertial offset of the strip of frames in the image in pixels as an int. Default: 0px
time_delta (optional)
The time between each frame in ms as an int. FPS is then equal to 1000/time_delta. Default: 30ms

Defined in animator.js


Constructor Summary
Animator(target)
           
 
Method Summary
 String getId()
           Return the ID of the element the animator is handling
 void setActive()
           Start the animation
 void setFinal()
           Stop the animation and place it in its final state.
 void setInitial()
           Stop the animation and place the animation in its initial state

Constructor Detail

Animator

Animator(target)

Method Detail

getId

String getId()

setActive

void setActive()

setFinal

void setFinal()

setInitial

void setInitial()


Documentation generated by JSDoc on Thu Oct 30 18:01:10 2008