This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSprite.hpp
134 lines (115 loc) · 4 KB
/
Sprite.hpp
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef SPRITERENDERER_H_
#define SPRITERENDERER_H_
#include "Component.hpp"
#include "Color.hpp"
#include <string>
namespace spic {
/**
* @brief A component representing a sprite (small image)
* @spicapi
*/
class Sprite : public Component {
public:
/**
* @brief Constructor
* @param sprite The source to the sprite
* @param flipX The flip of the x-axis of the sprite
* @param flipY The flip of the y-axis of the sprite
* @param sortingLayer The layer the sprite will be sorted on
* @param orderLayer The layer the sprite will be ordered on
* @sharedapi
*/
Sprite(const std::string& sprite, bool flipX, bool flipY, int sortingLayer, int orderLayer);
/**
* @brief Constructor
* @param sprite The source to the sprite
* @param color The color of the sprite
* @param flipX The flip of the x-axis of the sprite
* @param flipY The flip of the y-axis of the sprite
* @param sortingLayer The layer the sprite will be sorted on
* @param orderInLayer The layer the sprite will be ordered on
* @sharedapi
*/
Sprite(const std::string& sprite, const Color& color, bool flipX, bool flipY, int sortingLayer, int orderInLayer);
/**
* @brief The texture of the sprite
* @param sprite the path to the sprite
* @sharedapi
*/
void Texture(const std::string& sprite);
/**
* @brief The texture of the sprite
* @return The path of the sprite
* @sharedapi
*/
const std::string& Texture() const;
/**
* @brief The color of the sprite
* @param color the color
* @sharedapi
*/
void Color(const spic::Color& color);
/**
* @brief The color of the sprite
* @return the color
* @sharedapi
*/
const spic::Color& Color() const;
/**
* @brief Whether the sprite should be flipped on the X-axis
* @param flipX desired value
* @sharedapi
*/
void FlipX(bool flipX);
/**
* @brief Whether the sprite should be flipped on the X-axis
* @return current value
* @sharedapi
*/
bool FlipX() const;
/**
* @brief Whether the sprite should be flipped on the Y-axis
* @param flipY desired value
* @sharedapi
*/
void FlipY(bool flipY);
/**
* @brief Whether the sprite should be flipped on the Y-axis
* @return current value
* @sharedapi
*/
bool FlipY() const;
/**
* @brief The layer the sprite will be sorted on
* @param sortingLayer desired value
* @sharedapi
*/
void SortingLayer(int sortingLayer);
/**
* @brief The layer the sprite will be sorted on
* @return current value
* @sharedapi
*/
int SortingLayer() const;
/**
* @brief The layer the sprite will be ordered on
* @param orderInLayer desired value
* @sharedapi
*/
void OrderInLayer(int orderInLayer);
/**
* @brief The layer the sprite will be ordered on
* @return current value
* @sharedapi
*/
int OrderInLayer() const;
private:
std::string sprite;
spic::Color color;
bool flipX;
bool flipY;
int sortingLayer;
int orderInLayer;
};
}
#endif // SPRITERENDERER_H_