-
Notifications
You must be signed in to change notification settings - Fork 0
/
twSprite.h
55 lines (50 loc) · 1.63 KB
/
twSprite.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
#ifndef TWSPRITE_H_INCLUDED
#define TWSPRITE_H_INCLUDED
#include "twImage.h"
#include "twWidget.h"
class twSprite : public twObject
{
public:
twSprite(twImage *image = NULL);
void setPosition(twPosition position = twPosition(0, 0));
twPosition getPosition();
void setPositionf(twPositionf position = twPositionf(0, 0));
twPositionf getPositionf();
void move(int x, int y);
twImage* getImage();
void setImage(twImage *image);
void clear();
void setScale(double scale);
double getScale();
twColor getColor();
void setColor(twColor color);
void setRelativePosition(twPosition position);
twPosition getRelativePosition();
void setRotation(int rotation, twPosition position = twPosition(0, 0));
int getRotation();
twPosition getRotationPosition();
void attach(twSprite *sprite);
void setHorizontalMirror(bool h);
void setVerticalMirror(bool v);
bool getHorizontalMirror();
bool getVerticalMirror();
void setSize(twSize size);
twSize getSize();
void setImagePosition(twPosition position);
twPosition getImagePosition();
private:
twWidget *m_parent;
twImage *m_image;
twPosition m_position;
twPositionf m_positionf;
double m_scale;
twColor m_color;
twPosition m_relativePosition;
int m_rotation;
twPosition m_positionRotation;
std::vector<twSprite*> m_attachs;
bool m_mirrorH, m_mirrorV;
twSize m_size;
twPosition m_imagePosition;
};
#endif // TWSPRITE_H_INCLUDED