1 | /*! |
---|
2 | \file glmenu_imagescreen.h |
---|
3 | \brief 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 | public: |
---|
18 | GLMenuImageScreen (); |
---|
19 | GLMenuImageScreen (const TiXmlElement* root); |
---|
20 | void loadParams(const TiXmlElement* root); |
---|
21 | virtual ~GLMenuImageScreen (); |
---|
22 | |
---|
23 | void init (); |
---|
24 | |
---|
25 | void draw (); |
---|
26 | |
---|
27 | void setBackgroundImage(const char* backImageName); |
---|
28 | void setPosition(float offsetX, float offsetY); |
---|
29 | void setScale (float scaleX, float scaleY); |
---|
30 | void setPosScale(float offsetX, float offsetY, float scaleX, float scaleY); |
---|
31 | |
---|
32 | void setBarImage(const char* barImage); |
---|
33 | void setBarPosScale(float barX, float barY, float barW, float barH); |
---|
34 | |
---|
35 | void setMaximum (int maxValue); |
---|
36 | /** \returns the maximum of countable steps*/ |
---|
37 | inline int GLMenuImageScreen::getMaximum(void) const { return this->maxValue; }; |
---|
38 | |
---|
39 | void setValue (int currentValue); |
---|
40 | int getValue (); |
---|
41 | void step (); |
---|
42 | |
---|
43 | |
---|
44 | private: |
---|
45 | // background image |
---|
46 | char* backImageName; //!< the name of the file of the background image |
---|
47 | float offsetX; //!< X-offset of the the image from the left |
---|
48 | float offsetY; //!< Y-offset of the image from the top |
---|
49 | float scaleX; //!< width of the image |
---|
50 | float scaleY; //!< height of the image |
---|
51 | Material* backMat; //!< Background Material. |
---|
52 | |
---|
53 | // Load-Bar |
---|
54 | float barX; //!< X-position of the Bar |
---|
55 | float barY; //!< Y-position of the Bar |
---|
56 | float barW; //!< Width of the Bat |
---|
57 | float barH; //!< Height of the Bar. |
---|
58 | Material* barMat; //!< A Material for the Loading-Bar |
---|
59 | |
---|
60 | /* progress bar values */ |
---|
61 | int currentValue; //!< the current count of step() calls fired yet |
---|
62 | int maxValue; //!< total count of steps |
---|
63 | |
---|
64 | }; |
---|
65 | |
---|
66 | #endif /* _GLMENU_IMAGESCREEN_H */ |
---|