-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSlider.h
40 lines (32 loc) · 876 Bytes
/
Slider.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
#ifndef SLIDER_H_INCLUDED
#define SLIDER_H_INCLUDED
#include <allegro5/allegro.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
#include <allegro5/allegro_primitives.h>
#include "Object.h"
class Slider : public Object
{
public:
Slider(int, int);
virtual ~Slider();
void Draw();
void set_color(ALLEGRO_COLOR);
void set_label_content(const char*);
void toggleDrag() { dragged = !dragged; }
float Drag(int, int);
float getDegree() { return degree; }
int getLength() { return lengthOftrack; }
bool isClicked(int, int);
bool isDragged() { return dragged; }
private:
int target_x, target_y;
int track_x, track_y;
int lengthOftrack = 150;
float degree = 1.0;
bool dragged = false;
char label[20];
ALLEGRO_COLOR target_color;
ALLEGRO_FONT *font;
};
#endif // SLIDER_H_INCLUDED