GOOC - Game Oriented Object C

GOOC - Game Oriented Object C

Next: Font Animations, Previous: Vertex (3D) Animations, Up: Animations
[Contents]

12.2. Sprite Animations

12.2. Sprite Animations

Sprite animations use a single texture to display a sprite in-game, which always faces the camera. The collision box is autogenerated based on the object's scale. A single sprite animation can define multiple sprites, each of them being considered a separate frame of animation. Sprite animations are type 2.

Crash 1

Crash 1

The format for a sprite animation is as follows: #sprite anim-name tpag-eid anim-name is an identifier for the animation's name. tpag-eid is the EID of the texture page that contains the sprite(s).

This is then followed by a list of sprite definitions: #tex rgb color-mode blend-mode tex-x tex-y clut-x clut-y tex-w tex-h #tex rgb color-mode blend-mode tex-x tex-y clut-x clut-y tex-w tex-h ! flip wind rgb is the color modifier for the sprite, 0x808080 being the middle ground that does not alter the color. color-mode determines the sprite's color mode, from 0 to 2 (4-bit, 8-bit and 16-bit, respectively). blend-mode determines the blending mode for the sprite, from 0 to 3: transparency, additive, subtractive and solid. tex-x and tex-y determine the texture coordinates. clut-x and clut-y determine the coordinates of the color look-up table for the sprite, if used. tex-w and tex-h specify the width and height of the sprite, the value of each must be one of the following: 0, 4, 8, 16, 32, 64. Note that a sprite must fit entirely within a single segment of a texture page, which are split into four segments horizontally. Defining the ! portion is optional, and only needed for setting the sprite's flip and winding, respectively.

Crash 2

Crash 2

The format for a sprite animation is as follows: #sprite anim-name tpag-eid anim-name is an identifier for the animation's name. tpag-eid is the EID of the texture page that contains the sprite(s).

This is then followed by a list of sprite definitions: #tex rgb color-mode blend-mode tex-x tex-y clut-x clut-y tex-w tex-h rgb is the color modifier for the sprite, 0x808080 being the middle ground that does not alter the color. color-mode determines the sprite's color mode, from 0 to 2 (4-bit, 8-bit and 16-bit, respectively). blend-mode determines the blending mode for the sprite, from 0 to 3: transparency, additive, subtractive and solid. tex-x and tex-y determine the texture coordinates. clut-x and clut-y determine the coordinates of the color look-up table for the sprite, if used. tex-w and tex-h specify the width and height of the sprite, the value of each must be one of the following: 0, 4, 8, 16, 32, 64. Note that a sprite must fit entirely within a single segment of a texture page, which are split into four segments horizontally.