Articles and Tutorials

GSAnimator

A general purpose animation class.
Object
|
+--GSAnimator
Field Summary
 Object duration
          
 Object framerate
          
 Object from
          
 Object onfinish
          
 Object onstart
          
 Object setvalue
          
 Object to
          
 
Constructor Summary
GSAnimator (<GSPoint> from, <GSPoint> to, <int> framerate, <int> duration, <Function> setvalue, <Function> onstart, <Function> onfinish)
 
Method Summary
 void animate()
           Starts the animation.
 void stopAnimate()
           Stops the animation.

Field Detail

duration

Object duration

framerate

Object framerate

from

Object from

onfinish

Object onfinish

onstart

Object onstart

setvalue

Object setvalue

to

Object to
Constructor Detail

GSAnimator

GSAnimator(<GSPoint> from, <GSPoint> to, <int> framerate, <int> duration, <Function> setvalue, <Function> onstart, <Function> onfinish)
    GSAnimator should not be instantiated, all of its methods are called statically.
  •  
      from - the start position for the animation
      to - the end position for the animation
      framerate - the rate at which the animation frames should be drawn (in milliseconds)
      duration - the length of the animation (in milliseconds)
      setvalue - a user-defined function that is called every frame with a reference to the animator instance and the current position as arguments
      onstart - an optional user-defined function that is called when the animation is started
      onfinish - an optional user-defined function that is called when the animation has completed
  • Parameters:
Method Detail

animate

void animate()
    Starts the animation.

stopAnimate

void stopAnimate()
    Stops the animation. Generally there is no need to call this method explicitly as it is called by the animator itself when the animation has completed.