added rest of basics in TSE_Core
This commit is contained in:
38
TSE_Core/src/BehaviourScripts/ImageAnimation.hpp
Normal file
38
TSE_Core/src/BehaviourScripts/ImageAnimation.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#define IMAGE_ANIMATION typeid(ImageAnimation).name()
|
||||
|
||||
#include "Image.hpp"
|
||||
#include "elements/BehaviourScript.hpp"
|
||||
#include "elements/ImageAnimationSet.hpp"
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
class ImageAnimation : public BehaviourScript
|
||||
{
|
||||
private:
|
||||
std::unordered_map<string, ImageAnimationSet*> animations;
|
||||
string currentAnimation = "";
|
||||
int frame = 0;
|
||||
float deltatime = 0;
|
||||
|
||||
public:
|
||||
ImageAnimation();
|
||||
void SetAnimationSet(ImageAnimationSet* set);
|
||||
void SetAnimationSet(string name, ImageAnimationSet* set);
|
||||
void StartAnimation(const string name);
|
||||
int GetImageAnimationSetCount();
|
||||
ImageAnimationSet* GetImageAnimationAt(int& i);
|
||||
string& GetCurrentAnimation();
|
||||
int& GetCurrentFrame();
|
||||
float& GetDeltaTime();
|
||||
void RemoveAnimationSet(std::string& name);
|
||||
void OnUpdate() override;
|
||||
inline const char* GetName() override
|
||||
{
|
||||
return "Image Animation";
|
||||
}
|
||||
};
|
||||
} // namespace TSE
|
||||
Reference in New Issue
Block a user