4 * Created on: Aug 7, 2012
8 #ifndef GRAPHICS_GAUGE_H_
9 #define GRAPHICS_GAUGE_H_
11 #include "../geometry/Vector.h"
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) { }
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;
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; }
39 geometry::Vector<int> fullOffset;
40 geometry::Vector<int> emptyOffset;
50 #endif /* GRAPHICS_GAUGE_H_ */