1 | /*! |
---|
2 | * @file glmenu_imagescreen.h |
---|
3 | * class to display a LoadScreen |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _GLMENU_IMAGESCREEN_H |
---|
7 | #define _GLMENU_IMAGESCREEN_H |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | |
---|
11 | class Material; |
---|
12 | class TiXmlElement; |
---|
13 | |
---|
14 | //! A class to display a loadScreen |
---|
15 | class GLMenuImageScreen : public BaseObject |
---|
16 | { |
---|
17 | ObjectListDeclaration(GLMenuImageScreen); |
---|
18 | public: |
---|
19 | GLMenuImageScreen (const TiXmlElement* root = NULL); |
---|
20 | virtual void loadParams(const TiXmlElement* root); |
---|
21 | virtual ~GLMenuImageScreen (); |
---|
22 | |
---|
23 | void draw(); |
---|
24 | |
---|
25 | void setBackgroundImage(const std::string& backImageName); |
---|
26 | void setPosition(float offsetX, float offsetY); |
---|
27 | void setScale (float scaleX, float scaleY); |
---|
28 | void setPosScale(float offsetX, float offsetY, float scaleX, float scaleY); |
---|
29 | |
---|
30 | void setBarImage(const std::string& barImage); |
---|
31 | void setBarPosScale(float barX, float barY, float barW, float barH); |
---|
32 | |
---|
33 | void setMaximum (int maxValue); |
---|
34 | /** @returns the maximum of countable steps*/ |
---|
35 | inline int getMaximum() const { return this->maxValue; }; |
---|
36 | |
---|
37 | void setValue (int currentValue); |
---|
38 | int getValue (); |
---|
39 | void step (); |
---|
40 | |
---|
41 | |
---|
42 | private: |
---|
43 | // background image |
---|
44 | std::string backImageName; //!< the name of the file of the background image |
---|
45 | float offsetX; //!< X-offset of the the image from the left |
---|
46 | float offsetY; //!< Y-offset of the image from the top |
---|
47 | float scaleX; //!< width of the image |
---|
48 | float scaleY; //!< height of the image |
---|
49 | Material* backMat; //!< Background Material. |
---|
50 | |
---|
51 | // Load-Bar |
---|
52 | float barX; //!< X-position of the Bar |
---|
53 | float barY; //!< Y-position of the Bar |
---|
54 | float barW; //!< Width of the Bat |
---|
55 | float barH; //!< Height of the Bar. |
---|
56 | Material* barMat; //!< A Material for the Loading-Bar |
---|
57 | |
---|
58 | /* progress bar values */ |
---|
59 | int currentValue; //!< the current count of step() calls fired yet |
---|
60 | int maxValue; //!< total count of steps |
---|
61 | |
---|
62 | }; |
---|
63 | |
---|
64 | #endif /* _GLMENU_IMAGESCREEN_H */ |
---|