-
Notifications
You must be signed in to change notification settings - Fork 1
/
animation.h
62 lines (57 loc) · 1.18 KB
/
animation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef ANIMATION_H
#define ANIMATION_H
#include <SFML/Graphics.hpp>
#include "frame.h"
using sf::Clock,
sf::Time,
sf::Texture,
sf::Sprite,
sf::Vector2i,
sf::IntRect;
/**
* @brief The Animation class
*/
class Animation {
Clock clock;
Time elapsed;
Time updateTime;
Texture tex;
Sprite sprite;
Frame frame;
bool freeze = false;
public:
/**
* @brief Animation - Cuida da animação dos sprites
* @param filename
* @param frame
* @param updateTime
*/
Animation (const std::string& filename,
const Frame& frame,
const Time& updateTime);
/**
* @brief getSprite - Retorna o sprite atual da animação
* @return
*/
Sprite& getSprite();
/**
* @brief getFrame - Retorna a classe de controle de frames
* @return
*/
Frame& getFrame();
/**
* @brief update - Atualiza a posição do próximo frame que será exibido na tela
*/
void update();
/**
* @brief setFreeze
* @param value
*/
void setFreeze(bool value);
/**
* @brief getFreeze
* @return
*/
bool getFreeze() const;
};
#endif // ANIMATION_H