]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Gauge.h
added type description of Gauge
[l2e.git] / src / graphics / Gauge.h
1 /*
2  * Gauge.h
3  *
4  *  Created on: Aug 7, 2012
5  *      Author: holy
6  */
7
8 #ifndef GRAPHICS_GAUGE_H_
9 #define GRAPHICS_GAUGE_H_
10
11 #include "../geometry/Vector.h"
12
13 #include <SDL.h>
14
15 namespace graphics {
16
17 class Gauge {
18
19 public:
20         explicit Gauge(SDL_Surface *s = 0, int fullX = 0, int fullY = 0, int emptyX = 0, int emptyY = 0, int height = 1, int startWidth = 0, int repeatWidth = 1, int endWidth = 0)
21         : surface(s), fullOffset(fullX, fullY), emptyOffset(emptyX, emptyY), height(height), startWidth(startWidth), repeatWidth(repeatWidth), endWidth(endWidth) { }
22
23 public:
24         int MinWidth() const { return startWidth + endWidth; }
25         int Height() const { return height; }
26         void Draw(SDL_Surface *dest, const geometry::Vector<int> &position, int width, Uint8 fill) const;
27
28 public:
29         void SetSurface(SDL_Surface *s) { surface = s; }
30         void SetFullOffset(const geometry::Vector<int> &o) { fullOffset = o; }
31         void SetEmptyOffset(const geometry::Vector<int> &o) { emptyOffset = o; }
32         void SetHeight(int h) { height = h; }
33         void SetStartWidth(int w) { startWidth = w; }
34         void SetRepeatWidth(int w) { repeatWidth = w; }
35         void SetEndWidth(int w) { endWidth = w; }
36
37         static void CreateTypeDescription();
38
39 private:
40         SDL_Surface *surface;
41         geometry::Vector<int> fullOffset;
42         geometry::Vector<int> emptyOffset;
43         int height;
44         int startWidth;
45         int repeatWidth;
46         int endWidth;
47
48 };
49
50 }
51
52 #endif /* GRAPHICS_GAUGE_H_ */