4 * Created on: Aug 7, 2012
8 #ifndef GRAPHICS_GAUGE_H_
9 #define GRAPHICS_GAUGE_H_
11 #include "../geometry/Vector.h"
20 static const int TYPE_ID = 406;
23 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)
24 : surface(s), fullOffset(fullX, fullY), emptyOffset(emptyX, emptyY), height(height), startWidth(startWidth), repeatWidth(repeatWidth), endWidth(endWidth) { }
27 int MinWidth() const { return startWidth + endWidth; }
28 int Height() const { return height; }
29 void Draw(SDL_Surface *dest, const geometry::Vector<int> &position, int width, Uint8 fill) const;
32 void SetSurface(SDL_Surface *s) { surface = s; }
33 void SetFullOffset(const geometry::Vector<int> &o) { fullOffset = o; }
34 void SetEmptyOffset(const geometry::Vector<int> &o) { emptyOffset = o; }
35 void SetHeight(int h) { height = h; }
36 void SetStartWidth(int w) { startWidth = w; }
37 void SetRepeatWidth(int w) { repeatWidth = w; }
38 void SetEndWidth(int w) { endWidth = w; }
40 static void CreateTypeDescription();
41 static void Construct(void *);
45 geometry::Vector<int> fullOffset;
46 geometry::Vector<int> emptyOffset;
56 #endif /* GRAPHICS_GAUGE_H_ */