Animations are a sequence of frames, described by a text file in the AIR format. As in DEF file, it follows the same INI-like structure, containing just one type of section, the [Begin Action]. This section is populated by frames and frame modifier elements such as loop points and interpolation directives.
[Begin Action {ActionNo}]
Frame contact boxes (optional)
Frame modifier elements (optional)
Frame element
...
{ActionNo} is a positive integer value used as the animation Identifer.
Frame element:
This element represents the frame itself, with all information needed to present it on screen. Format:
SpriteIdentifier, XOffset, YOffset, Duration [, [FlipFlags] [, [BlendMode] [, [XScale] [, [YScale] [, [ZAngle] ] ] ] ] ]
Components enclosed by [] are optional (doesn't include []). You can left optional components in blank to use a another after it, eg.: 0,0, 0,0, 1, , A.
XOffset and YOffset are integer values that displaces the Sprite's axis horizontally by X pixels, and vertically by Y pixels.
If Duration is -1, then frame is displayed indefinitely.
For FlipFlags, H = horizonal flip, V = vertical flip.
For BlendMode, S = Substraction blending, AS{0-256}D{0-256} = Addition blending (S = source color factor and D = destination color factor. These are values from 0 to 256. 0 means black and 256 the original color, so you can create various effects by playing with these values. The source factor is applied to the frame's Bitmap, and destination factor is applied to the color being overwritten by source), A = Addition blending with S = 256 and D = 256 (no source and destination changes), A1 = Addition blending with S = 256 and D = 128 (original source on 50% darkened destination).
XScale and YScale are float values for scaling factors of each axis.
ZAngle is the angle to rotate the frame around Z axis in degrees, counterclockwise.
Frame modifier element:
This element affects the frame bellow it.
- loopstart: Indicates that the frame it affects will be the next loop point after reaching the animation's end (last frame). If ommited, the first frame will be the loop point.
- interpolate offset: The XOffset/YOffset during all ticks in between previous and the frame it affects will be interpolated.
- interpolate blend: The BlendMode during all ticks in between previous and the frame it affects will be interpolated.
- interpolate scale: The XScale/YScale during all ticks in between previous and the frame it affects will be interpolated.
- interpolate angle: The ZAngle during all ticks in between previous and the frame it affects will be interpolated.
For interpolation, the default behavior if ommited is just jump from the value of the last frame to the next one, without any interpolation.
Frame contact boxes:
Contact boxes (CLSNs) are used for collision and hit tests. Currently, only used in character's AIR.
There's two types: CLSN1 for hit test, and CLSN2 for collision. These are valid just for the frame it belong to (the bellow one). But, it's possible to make a CLSN valid for more frames appending the keyword Default. Default CLSNs remain valid in all next frames that haven't a CLSN declaration of the same kind (1 or 2), and stops being used in the first frame with a CLSN declaration (of the same kind).
The CLSN declaration format is:
Clsn{TypeNo}[Default]:
Clsn{TypeNo}[{IndexNo}] = Left, Top, Right, Bottom
...
There's no limit in the number of boxes per frame/CLSN type. But keeping it at a minimum is highly recommended.
- {TypeNo}: 1 for hit and 2 for collision. Can be ommited for the CLSN itself (the second line).
- {IndexNo}: Integer index of the CLSN in the list, starting from 0 (optional).
- Left: This is how much (in pixels) the box extends to the left from the frame's axis (Sprite's axis + frame's offset).
- Top: This is how much (in pixels) the box extends to the top from the frame's axis (Sprite's axis + frame's offset).
- Right: This is how much (in pixels) the box extends to the right from the frame's axis (Sprite's axis + frame's offset).
- Bottom: This is how much (in pixels) the box extends to the bottom from the frame's axis (Sprite's axis + frame's offset).
Note: Even that TypeNo and IndexNo are optional (for the lines with the coordinates of the box), it's highly recommended to keep it as tools like Fighter Factory are made to follow the Elecbyte M.U.G.E.N's syntax.
Example:
Clsn2Default: Clsn2[0] = -10, -10, 10, 10 Clsn2[1] = -20, -20, 20, 20 0,0, 0,0, 10 0,1, 0,0, 10 0,2, 0,0, 10 Clsn2Default: Clsn2[0] = -30, -30, 30, 30 0,3, 0,0, 10 0,4, 0,0, 10 Clsn2: Clsn2[0] = -15, -15, 15, 15 0,5, 0,0, 10 0,6, 0,0, 10
In the example above, the first two CLSN2 from frame 0,0 remain valid until frame 0,2. Starting on frame 0,3 a new CLSN2 takes place, and lasts until frame 0,4. On frame 0,5 another CLSN2 is used and is active only on this frame (no Default keyword here), replacing the previous one. On frame 0,6 there's no CLSN at all.
Animation Example:
[Begin Action 55] Clsn2Default: 2 Clsn2[0] = -40,0,40,-316 Clsn2[1] = -16,-368,24,-316 5,0, 0,0, 4, H loopstart 5,0, 0,0, 4 interpolate offset 5,0, 10,10, 4, A1 interpolate blend 5,0, 10,10, 4, A