-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectBox.h
More file actions
30 lines (27 loc) · 777 Bytes
/
SelectBox.h
File metadata and controls
30 lines (27 loc) · 777 Bytes
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
#ifndef SelectBox_h
#define SelectBox_h
#include <SFML/Graphics.hpp>
using namespace sf;
class SelectBox : public Drawable , public Transformable
{
public:
SelectBox(IntRect box, Color color, bool mid = 0);
SelectBox(Color color);
void setAlpha(char alpha);
char getAlpha() { return this->vertices[2].color.a; }
void fade(char alpha);
void select(short int x);
void select();
void deselect();
void setCenter(short int x);
void moveCenter(short int amount);
void setBox(IntRect box, bool mid = 0);
virtual void draw(RenderTarget& target, RenderStates states = RenderStates::Default) const; // from Drawable
private:
short int width;
short int xChange;
short int xDest; // target for x of center
char aChange;
VertexArray vertices;
};
#endif // !SelectBox_h