A simple, fast and efficient Spriter implementation in pure C#
I'm working on version 2.0 inspired with the development philosophy inspired by the fantastic Handmade Hero. I'll try to implement all the current open issues in version 2.0.
The goal of SpriterDotNet is to be as fast as possible while keeping the code clean and readable. Being a pure C# implementation, SpriterDotNet doesn't depend on any external libraries / frameworks. It focuses on simple and efficient calculations of all transforms at a given point in time. This allows using it with any framework just by mapping calculated transforms to concrete objects.
Refer to the specific documentation for each plugin.
There are a lot of different ways of using this plugin but this is probably the most efficient for the majority of scenarios:
For already implemented plugins refer to their own documentation pages.
SpriterDotNet's default configuration should be good enough for most users but it is designed in a way that allows customising almost everything.
FrameData contains all the information about the state of the animation (or blend of multiple animations) at a certain point in time.
The config is used to configure common properties of default implementations.
The Animator uses providers to get Sprites, Sounds and data for every frame.
The ProviderFactory is responsible for constructing/pooling/reusing provider instances. An instance of IProviderFactory can be passed as an optional argument when constructing the Animator. The default implementation is designed to:
AssetProviders are responsible for providing Sprites and Sounds and for taking care of all the relevant manipulations (like applying character maps). They are exposed as properties in the Animator and can be swapped with customised implementations.
The Frame Data Provider is responsible for providing FrameData for the given point in time. SpriterDotNet comes with these implementations:
This class contains the majority of Properties and Methods necessary to control the animation.
Animation blending is possible only between animations with identical hierarchies. Blending incompatible animations will cause strange behaviour. SpriterDotNet only performs a simple check to determine compatibility in order to avoid crashing but that might not be enough in some cases.
All the parsing and processing is done through a SpriterReader instance. This class has a collection of ISpriterParsers and ISpriterPreprocessors. The Read method calls all the registered parsers in sequence until the first parsing success. Then it iterates over all preprocessors invoking them on the spriter instance. SpriterDotNet comes with these default implementations:
For questions, feedback, complaints, etc, use the related topic on Spriter Forum
Also, feel free to drop a note if you use SpriterDotNet in your game/project and I'll be happy to add a showcase section with links to your game/project.