Relevant to Animated BG's:
Animated background elements
The format for specifying an animated background element is almost exactly the same as for a normal background element. There are only three notable differences, which will be explained below.
type = anim
actionno = 55
(all other parameters other than spriteno are the same as for static background elements.)
First, for the element to animate, a type of anim must be specified. Second, an "action number" (actionno) must be specified. This replaces the spriteno parameter that would be used for a normal background element. The value of actionno must be for an animation that is defined in the DEF file. In this example, since actionno is 55, Action 55 must be defined in a manner similar to the following:
[Begin Action 55]
The format is the same as specifying animations in the AIR file, so details will be omitted here. The Action definition can be placed anywhere below the original [BGDef] group. Typical strategies are either to define the action immediately after the element it belongs to, or else to collect all the stage's actions together at the beginning or end of the [BGDef] group.
Note that each sprite you specify in the animation has its own axis (specified in the SFF file). During animation playback, the axis of each sprite will be lined up to correspond with the axis of the background element itself.
The effect of the tilespacing parameter is different for anim-type elements compared to normal-type elements. For a normal element, the x-value of this parameter specifies the horizontal distance between the right edge of the first tile and the left edge of the second tile. In the case of an anim element, the x-value specifies the horizontal distance between the left edge of the first tile and the left edge of the second tile. This applies similarly for the y-value. The reason for the difference is because the size of an anim is not necessarily constant. tilespacing defaults to 1,1 for anim-type elements.
The final difference between animated and normal elements is that animated elements always have mask = 1.