-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.h
51 lines (39 loc) · 1.21 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
#ifndef ANIMATION_H_INCLUDED
#define ANIMATION_H_INCLUDED
#include <SFML/Graphics.hpp>
#include <iostream>
class Animation
{
public:
Animation();
//Destructeur
~Animation();
//Initialise l'animation
void initialize(float x, float y, int frameX, int frameY);
//Actualise les frame
void update(sf::RenderWindow &app);
//Dessine les naimations
void draw(sf::RenderWindow &app);
//Accesseurs public
bool getActive();
void setActive(bool value);
int getCurrentFrame(int axis);
void setCurrentFrame(int axis, int value);
int getPosition(int axis);
void setPosition(int axis, int value);
void setImage(sf::Image &tempImage);
int getFrameWidth();
int getFrameHeight();
protected:
//Sprite qui contient l'image
sf::Sprite sprite;
//Numéro de frame, nombre de frame, ...
float frameCounter, switchFrame, amountOfFrameX, amountOfFrameY, x,y;
//Frame en cours
int currentFrameX, currentFrameY;
//Animation lancée ou non
bool active;
//Comptage temps
sf::Clock clock;
};
#endif // ANIMATION_H_INCLUDED