Sprite - Animation Sequences

Animation sequences help the develeloper handle animations more easily.

Sequences are arrays of u32 variables. Each of these variables is a frame index of the sprite.

The starting sequence looks like this:

When you do NextFrame() on a Sprite which has 4 frames without modifying its
sequence, frames get changed like this:
[0] -> [1] -> [2] -> [3] -> [0] -> ...
This happens, when you do PrevFrame()
[0] -> [3] -> [2] -> [1] -> [0] -> ...
As you can see, it is pretty straightforward.

Now we assign an own sequence.
When assigning a sequence, each of its members musn't be bigger than actual frames available, or it won't get set. So if we assign the sequence to u32 seq[6] = {0, 3, 1, 1, 2, 3}; this happens:

On NextFrame():
[0] -> [3] -> [1] -> [1] -> [2] -> [3] -> [0] -> ...
On PrevFrame():
[0] -> [3] -> [2] -> [1] -> [1] -> [3] -> [0] -> ...

The sequence just keeps on looping and only changes when you assign a new one or change to an Image with fewer frames than the current one. So as you may see, sequencing can help you a lot with your animation needs.


Generated on Wed Jun 18 01:50:00 2008 for libwiisprite by  doxygen 1.5.5