-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGProgressBar.h
60 lines (45 loc) · 1.3 KB
/
GProgressBar.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
56
57
58
59
60
#ifndef __GPROGRESSBAR_H__
#define __GPROGRESSBAR_H__
#include "FairyGUIMacros.h"
#include "GComponent.h"
#include "cocos2d.h"
NS_FGUI_BEGIN
class GProgressBar : public GComponent
{
public:
GProgressBar();
virtual ~GProgressBar();
CREATE_FUNC(GProgressBar);
ProgressTitleType getTitleType() const { return _titleType; }
void setTitleType(ProgressTitleType value);
double getMin() const { return _min; }
void setMin(double value);
double getMax() const { return _max; }
void setMax(double value);
double getValue() const { return _value; }
void setValue(double value);
void tweenValue(double value, float duration);
void update(double newValue);
protected:
virtual void handleSizeChanged() override;
virtual void constructExtension(ByteBuffer* buffer) override;
virtual void setup_afterAdd(ByteBuffer* buffer, int beginPos) override;
bool setFillAmount(GObject* bar, float amount);
private:
double _min;
double _max;
double _value;
ProgressTitleType _titleType;
bool _reverse;
GObject* _titleObject;
GObject* _barObjectH;
GObject* _barObjectV;
float _barMaxWidth;
float _barMaxHeight;
float _barMaxWidthDelta;
float _barMaxHeightDelta;
float _barStartX;
float _barStartY;
};
NS_FGUI_END
#endif