TiledLayer - Animations

Animations can help you bring that little movement in a normally static layer.

You probably already understand how to set cells on a TiledLayer and how to draw them. TiledLayer can actually help you make these tiles animated, without big hassle for the developer.

Animations are basically negative numbers which have a positive tile assigned to them. When you initialize TiledLayer, you specify how many of these animation tiles you want to possibly have.

If you want to get a new index for an animated tile, call CreateAnimatedTile() and the TiledLayer will return a new nuber to use. The first animated tile is -1, the second is -2, the third -3 and so on. You can SetCell() or FillCell() the TiledLayer with this index.

The first assigned value to an animated tile is 0, to change it, you can use SetAnimatedTile(). To retrieve the current assigned value, you can use GetAnimatedTile(). You will see how every tile you assigned with the animated tile changes to this new tile.

Developers should make their own animation flip methods to animate water with tiles or to make a fire flicker. Animated tiles just make it easier.


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