Animation format

From FIFE development wiki
Jump to: navigation, search
wiki
Document Data structures Data strucures
Concepts illustrated here are relevant to understand what kind of data FIFE engine is able to process.

Introduction

The purpose of this page is to explain the FIFE XML animation format in full, with all the elements and their attributes fleshed out.

Animation File Structure

Animations defines how images are shown in a sequence.

  • attributes
    • delay: common delay for all the frames in this animation. Type = int
    • action: action frame number (e.g. point when punch hits the target in punch animation). Type = int
    • x_offset: common x offset in pixels for all frames. Type = int
    • y_offset: common y offset in pixels for all frames. Type = int
  • frame
    • source: The image file to use for this frame of the animation. The file path is relative to the animation XML file. Type = string
    • delay: frame specific delay, overrides common delay (for this frame). Type = int
    • x_offset: frame specific x offset in pixels, overrides common x_offset (for this frame). Type = int
    • y_offset: frame specific y offset in pixels, overrides common y_offset (for this frame). Type = int

Examples

  <animation delay="130">
    <frame source="image1.jpg"/>
    <frame source="image2.jpg"/>
    <frame source="image3.jpg"/>
  </animation>
  <animation delay="130" action="3" x_offset="0" y_offset="0">
    <frame source="image1.jpg" x_offset="-12" y_offset="30" delay="130"/>
    <frame source="image2.jpg" delay="10"/>
    <frame source="image3.jpg" x_offset="2" />
    <frame source="image4.jpg" y_offset="28" delay="1"/>
  </animation>