MochiEngine
Loading...
Searching...
No Matches
Mochi::Graphics::AsepriteAnimationFactory Class Reference

This AnimationFactory takes Aseprites spritesheet export format and automatically generates all needed animation data for that spritesheet. More...

#include <AsepriteAnimationFactory.h>

Inheritance diagram for Mochi::Graphics::AsepriteAnimationFactory:
Mochi::Graphics::IAnimationFactory

Public Member Functions

 AsepriteAnimationFactory (FS::PackCatalog *)
virtual std::shared_ptr< AnimationsDataGetAnimationsData (const std::string &animationDataPath) override
 Gets the processed animation data of the file on the input path.
virtual void DeleteCache () override
 Deletes the animations cache. This should be safe to call anytime because of the shared pointers.
virtual void DeleteAnimation (const std::string &texturePath) override
 Deletes a specific animation in the cache. This should be safe to call anytime because of the shared pointers.

Detailed Description

This AnimationFactory takes Aseprites spritesheet export format and automatically generates all needed animation data for that spritesheet.

Animation data is expected as a JSON with specific configuration as shown in the image.

img def

Member Function Documentation

◆ DeleteAnimation()

void Mochi::Graphics::AsepriteAnimationFactory::DeleteAnimation ( const std::string & texturePath)
overridevirtual

Deletes a specific animation in the cache. This should be safe to call anytime because of the shared pointers.

Parameters
texturePathPath or unique identifier of the file in the file system.

Implements Mochi::Graphics::IAnimationFactory.

◆ DeleteCache()

void Mochi::Graphics::AsepriteAnimationFactory::DeleteCache ( )
overridevirtual

Deletes the animations cache. This should be safe to call anytime because of the shared pointers.

Implements Mochi::Graphics::IAnimationFactory.

◆ GetAnimationsData()

std::shared_ptr< AnimationsData > Mochi::Graphics::AsepriteAnimationFactory::GetAnimationsData ( const std::string & animationDataPath)
overridevirtual

Gets the processed animation data of the file on the input path.

Parameters
animationDataPathPath or unique identifier of the file containing the animation data in the file system.
Returns
A shared pointer to the data. This is meant to be saved as a cache.

Implements Mochi::Graphics::IAnimationFactory.


The documentation for this class was generated from the following files: