17#ifndef _FGE_ANIM_MANAGER_HPP_INCLUDED
18#define _FGE_ANIM_MANAGER_HPP_INCLUDED
20#include "FastEngine/fge_extern.hpp"
22#include "FastEngine/C_vector.hpp"
23#include "FastEngine/manager/C_baseManager.hpp"
24#include "FastEngine/textureType.hpp"
27#define FGE_ANIM_DEFAULT_TICKS 100
29#define FGE_ANIM_BAD FGE_MANAGER_BAD
98 using BaseManager::BaseManager;
101 [[nodiscard]]
bool isInitialized()
override;
102 void uninitialize()
override;
139 bool loadFromFile(std::string_view name, std::filesystem::path
const& path);
Manage animations.
Definition anim_manager.hpp:96
bool loadFromFile(std::string_view name, std::filesystem::path const &path)
Load the animation with the given name from the given file path.
bool initialize() override
Initialize the manager.
Base class for all managers.
Definition C_baseManager.hpp:63
AnimationType
Enum that represent different way of loading an animation.
Definition anim_manager.hpp:40
@ ANIM_TYPE_SEPARATE_FILES
Separate files, every frame is in a different file.
@ ANIM_TYPE_TILESET
Tileset type, you have just one texture with multiple frame in it.
FGE_API AnimationManager gManager
The global animation manager.
Structure that contains the information of an animation.
Definition anim_manager.hpp:76
std::shared_ptr< TextureType > _tilesetTexture
The tileset texture, only useful if the type is ANIM_TYPE_TILESET.
Definition anim_manager.hpp:81
std::vector< AnimationGroup > _groups
The vector of groups of the animation.
Definition anim_manager.hpp:77
Vector2u _tilesetGridSize
The tileset grid size, only useful if the type is ANIM_TYPE_TILESET.
Definition anim_manager.hpp:80
std::filesystem::path _tilesetPath
The tileset texture path, only useful if the type is ANIM_TYPE_TILESET.
Definition anim_manager.hpp:82
AnimationType _type
The type of the animation.
Definition anim_manager.hpp:79
Structure that contains the information of a frame of an animation.
Definition anim_manager.hpp:51
fge::Vector2u _texturePosition
The tileset grid position, only useful if the type is ANIM_TYPE_TILESET.
Definition anim_manager.hpp:54
std::filesystem::path _path
The file path of the texture.
Definition anim_manager.hpp:53
uint32_t _ticks
The number of ticks that the frame will be displayed, by default 1 tick take 100 ms.
Definition anim_manager.hpp:56
std::shared_ptr< fge::TextureType > _texture
The shared pointer texture of the frame.
Definition anim_manager.hpp:52
Structure that contains the information of a group of frames of an animation.
Definition anim_manager.hpp:65
std::vector< AnimationFrame > _frames
The vector of frames of the group.
Definition anim_manager.hpp:66
std::string _groupName
The name of the group.
Definition anim_manager.hpp:67
Definition anim_manager.hpp:86
Definition C_baseManager.hpp:42