GlistEngine
Loading...
Searching...
No Matches
gSpriteAnimator.h
Go to the documentation of this file.
1/*
2 * gSpriteAnimator.h
3 *
4 * Created on: 22 Eyl 2021
5 * Author: kayra
6 */
7
8#ifndef ANIMATION_GSPRITEANIMATOR_H_
9#define ANIMATION_GSPRITEANIMATOR_H_
10
11#include "gSpriteAnimation.h"
12#include <map>
13#include <memory>
14
25class gSpriteAnimator : public gObject {
26public:
29
41 void addAnimation(int animationId, gSpriteAnimation* animation);
42
51 void changeAnimation(int animationId);
52
59 void setFps(int animationId, int fps);
60
64 void update();
65
75 void draw(int x, int y);
76
89 void draw(int x, int y, int w, int h);
90
91private:
92 int currentanimation;
93 std::map<int, std::unique_ptr<gSpriteAnimation>> animations;
94};
95
96#endif /* ANIMATION_GSPRITEANIMATOR_H_ */
Definition gObject.h:33
Definition gSpriteAnimation.h:73
Definition gSpriteAnimator.h:25
void draw(int x, int y)
void setFps(int animationId, int fps)
void addAnimation(int animationId, gSpriteAnimation *animation)
virtual ~gSpriteAnimator()
void draw(int x, int y, int w, int h)
void changeAnimation(int animationId)