Difference between revisions of "Animation format"

From FIFE development wiki
Jump to: navigation, search
m
(Examples)
Line 35: Line 35:
 
<div style="margin:4px; padding:5px; border:1px solid #cdcdcd;">
 
<div style="margin:4px; padding:5px; border:1px solid #cdcdcd;">
 
<source lang="xml">
 
<source lang="xml">
   <animation delay="130" action="hero:leatherarmor:sword:walk" x_offset="0" y_offset="0">
+
   <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="image1.jpg" x_offset="-12" y_offset="30" delay="130"/>
 
     <frame source="image2.jpg" delay="10"/>
 
     <frame source="image2.jpg" delay="10"/>

Revision as of 07:23, 14 October 2011

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: path to image. 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>