-
Notifications
You must be signed in to change notification settings - Fork 0
/
sprite.h
48 lines (44 loc) · 1.28 KB
/
sprite.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
#ifndef SPRITE_H
#define SPRITE_H
#include <SFML/Graphics.hpp>
#include <map>
#include <string>
#include <iostream>
#include "animation.h"
using namespace std;
namespace SSJ{
class Sprite
{
private:
public: map <string, sf::Texture *> textures;
map <string, Animation *> animations;
sf::Sprite *sprite;
string defaultTexture;
string activeTexture;
bool smooth;
sf::Color alphaMaks;
bool alphaMaksSet;
public: string activeAnimation;
bool AnyTextureActive;
public:
static void updateAllSprites();
void AddTexture(string key, string path);
void AddTexture(string key, sf::Texture* texture, sf::IntRect clip); // To implement
void AddAnimation(Animation *);
void ActiveAnimation(string);
void DeactivateAnimation();
void setTexture(string);
bool isAnyTextureActive();
static vector <Sprite *> allSprites;
Animation* getAnimation(string);
Sprite();
void Update();
sf::Sprite *getSprite() ;
void setSprite(sf::Sprite sprite);
bool getSmooth() const;
void setSmooth(bool value);
sf::Color getAlphaMaks() const;
void setAlphaMaks(const sf::Color &value);
};
}
#endif // SPRITE_H