Asesprite files (.aseprite) can be used in FlatRedBall projects to create AnimationChainLists. Each tag creates an AnimationChain with a matching name. FlatRedBall natively supports .aseprite files so no additional integration (nuget packages or plugins) are needed.
Support for .aseprite files is available for projects which link to source code (and which build the FRB Editor) as of April 6, 2024. Support will be available as of the May 2024 release for binaries.
To add an .aseprite file to FlatRedBall, drag+drop the file the same as if adding any other file such as a .png or .wav.
.aseprite files added to FlatRedBall projects are loaded as AnimationChainLists.
Once a .aseprite file is loaded, it can be used just like any AnimationChainList. This includes:
Referencing the file in a Sprite
Referencing its animations in a top down or platformer entity
Using the loaded AnimationChainList in code
Note that the .aseprite file generates its own texture used by the AnimationChainLists.
Each .aseprite file generates its own texture. Therefore, if two .aseprite files are added to a FlatRedBall project, each creates its own Texture2D. Projects should attempt to put as many animations (tags) into a single .aseprite file to reduce render breaks. Unless memory considerations require otherwise, the most performant approach is to use a single large .aseprite file which contains all animations.
Each tag creates an AnimationChainList with one animation for each tag. If tags overlap, then multiple animations may be created, each containing AnimationFrames which share texture coordinates.
For example, consider the following timeline:
A file with this timeline would load as an AnimationChainList with the following animations:
idle
movement
jump
Prejump
Rise
Jump Crest
Fall
Landing
Dash
The naming of the tags carries over exactly as the tag is written, including spacing and capitalization. Each frame is created with the appropriate time and references the atlas.
The following features in AnimationChainLists are not supported through .aseprite files:
XOffset and YOffset
Collision shapes
FlipHorizontal and FlipVertical
These may be added in future updates.