githubEdit

AnimationChainListSave

Introduction

AnimationChainListSaves are the "save"arrow-up-right object type for AnimationChainListsarrow-up-right. AnimatiohChainListSaves can be used to create and load .achx files. For general information on common FlatRedBall types, see the FlatRedBall File Typesarrow-up-right wiki entry.

The AnimationChainListSave class is a standardized way to save an AnimationChainListarrow-up-right. Using the AnimationChainListSave class has the following benefits:

  1. Requires very little code to use

  2. Resulting files are 100% compatible with the FRBDK or any other application that can load .achx files.

Loading a .achx file

You can load load a AnimationChainListSave as follows:

AnimationChainListSave saveInstance = AnimationChainListSave.FromFile("fileName.achx");

Saving a .achx file

The following code saves a .achx file named MyAnimationChainList.achx. It assumes that animationChainList is a valid AnimationChainListarrow-up-right.

Add the following using statements:

using FlatRedBall.Content.AnimationChain;
using FlatRedBall.Graphics.Animation;

Assumes animationChainList is a valid AnimationChainList:

 AnimationChainListSave save =
    AnimationChainListSave.FromAnimationChainList(animationChainList);
 string fileName = "MyAnimationChainList.achx";
 save.Save(fileName);

Saving a loaded AnimationChainListSave

Of course, you can save a loaded AnimationChainListSave:

Of course, the code above does nothing; however, you can do things to the saveInstance between the load and save calls:

In fact, you can do pretty much anything to an AnimationChainListSave instance and it will result in a valid .achx file when saving it out. This enables you to easily create tools to create and modify .achx files.

Did this article leave any questions unanswered? Post any question in our forumsarrow-up-right for a rapid response.

Last updated

Was this helpful?