Game Editor: Sprite image settings

  The level editor uses the sprite image system to display sprites. A compatible game will use this system as well.

To use the sprite image system in your game, you would #include the sprite.as file. If you open this file in flash, the comments at the top will explain how to use this system and go over the settings

The settings will also be explained here for convenient reference. The sprite image system uses these settings to control what a sprite looks like.



Sprite image settings
charset   This string is the filename of the image that contains the graphics for this sprite.

directions   This number is how many directions this sprite can face.

direction   This number is the direction this sprite is currently facing.
The directions are arranged in clockwise order, with Zero at the top, 1 below it, 2 below that, etc...
You can also use the strings "up" "right" "down" and "left".
When you pass these strings to the sprite system, it'll convert them into the numbers that correspond with those directions.

frames   This number is how many frames of animation this sprite has. Each direction and pose in an image have the same number of animation frames.

frame   This number is the frame that the animation starts on. The sprite will also jump to this frame when the animation is stopped.

pose   A single charset image can contain multiple sets of sprites, each with its own directions and animation frames. This number selects which one to use.

columns   This number specifies how many sets of sprites are tiled, side by side, in this charset.

rows   This number specifies how many sets of sprites are tiled on top of each other in this charset.

isAnimating   This boolean controls whether or not this sprite is animating

animType   This string controls how this sprite animates.
"loop"
"yoyo"
"once"

animDirection   This number controls whether the sprite animates forwards or backwards through its frames.

delay   This number controls how fast the sprite animates.
The lower the number, the faster it goes.
   

Last updated: February 19, 2010