Class GSAnimator
A general purpose animation class.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSAnimator(from, to, framerate, duration, setvalue, onstart, onfinish)
Constructs a new
GSAnimator instance |
| Method Attributes | Method Name and Description |
|---|---|
|
animate()
Starts the animation.
|
|
|
Stops the animation.
|
Class Detail
GSAnimator(from, to, framerate, duration, setvalue, onstart, onfinish)
Constructs a new
GSAnimator instance
- Parameters:
- {GSPoint} from
- the start position for the animation
- {GSPoint} to
- the end position for the animation
- {int} framerate
- the rate at which the animation frames should be drawn (in milliseconds)
- {int} duration
- the length of the animation (in milliseconds)
- {Function} setvalue
- a user-defined function that is called every frame with a reference to the animator instance and the current position as arguments
- {Function} onstart
- an optional user-defined function that is called when the animation is started
- {Function} onfinish
- an optional user-defined function that is called when the animation has completed
Method Detail
animate()
Starts the animation.
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.