Name: | Animation |
Version: | 1.0 |
ID: | ID_ANIMATION |
Status: | Unspecified |
Category: | GUI |
Date: | February 2001 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems (c) 2000-2001. All rights reserved. |
Short: | Creates animations within graphical areas. |
The Animation is a graphical class that demonstrates the power of splitting rendered graphics into animated frames. Unlike conventional animation techniques where the graphics may be pre-rendered or drawn using a paint package and saved as animated gif files, frame based animation is calculated in real-time. This technique uses a minimal amount of memory and gives you the ability to animate rendered graphics as well as images. For example, an individual line could be be animated to give the illusion of rotation, or a circle could expand and shrink with a simple set-up.
Here is a basic animation that switches between a rectangle and circle shape every second:
<render center width="20%" height="20%" colour="#a0a0a0"> <animation speed="1" framecount="2"/> <box width="10" height="10" border="#000000" center frame="1"> <ellipse width="10" height="10" center frame="2" border="#000000"> </render>
The two most important fields that you need to set are the Speed and FrameCount fields. The Speed field determines the amount of frames per second (FPS) to be used when drawing the animation. The FrameCount is a compulsory setting that determines the total amount of frames included in the animation. In most cases, this is all that you need to worry about.
Any objects that you use in the animation must be able to support frames. Most graphical objects support a Frame field as standard, but check the documentation to make sure. Objects that do not support frames or have not been given a frame setting will inevitably be drawn to the graphics container in all conditions - i.e. they will ignore the Animation object.
The Animation object consists of the following public fields:
Drawable Refers to the drawable that the Animation is being applied to. Frame Reflects the current frame number. FrameCount The total number of frames being used in the animation. Speed Sets the speed of the animation in frames per second.
Field: | Frame | |
Short: | Reflects the current frame number. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | FrameCount | |
Short: | The total number of frames being used in the animation. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | Speed | |
Short: | Sets the speed of the animation in frames per second. | |
Type: | FLOAT | |
Status: | Read/Write | |
|