Changeset 4261 in orxonox.OLD for orxonox/trunk/src/glmenu
- Timestamp:
- May 22, 2005, 3:19:57 AM (20 years ago)
- Location:
- orxonox/trunk/src/glmenu
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/glmenu/glmenu_imagescreen.cc
r4136 r4261 19 19 #include "glmenu_imagescreen.h" 20 20 21 #include "stdincl.h"22 21 #include "graphics_engine.h" 23 22 #include "material.h" 23 #include "factory.h" 24 24 25 25 CREATE_FACTORY(GLMenuImageScreen); … … 38 38 \param root The Element to load the GLMenu from 39 39 */ 40 GLMenuImageScreen::GLMenuImageScreen (TiXmlElement* root)40 GLMenuImageScreen::GLMenuImageScreen(const TiXmlElement* root) 41 41 { 42 42 this->init(); 43 this->load(root); 44 43 this->loadParams(root); 45 44 } 46 45 … … 56 55 \li ElementCount: INT: how many elements will be loaded 57 56 */ 58 void GLMenuImageScreen::load(TiXmlElement* root) 59 { 60 const char* string; 61 62 // Model Loading 63 string = grabParameter( root, "BackgroundImage"); 64 if( string != NULL) 65 this->setBackgroundImage(string); 66 67 string = grabParameter(root, "BackgroundPS"); 68 if (string != NULL) 69 { 70 float f1, f2, f3, f4; 71 sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4); 72 this->setPosition(f1,f2); 73 this->setScale(f3,f4); 74 } 75 76 string = grabParameter( root, "BarImage"); 77 if (string != NULL) 78 this->setBarImage(string); 79 string = grabParameter(root, "BarPS"); 80 if (string != NULL) 81 { 82 float f1, f2, f3, f4; 83 sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4); 84 this->setBarPosScale(f1,f2,f3,f4); 85 } 86 87 string = grabParameter( root, "ElementCount"); 88 if (string != NULL) 89 this->setMaximum(atoi(string)); 57 void GLMenuImageScreen::loadParams(const TiXmlElement* root) 58 { 59 LoadParam<GLMenuImageScreen>(root, "BackgroundImage", this, &GLMenuImageScreen::setBackgroundImage) 60 .describe("sets the image to load onto the loadscreen"); 61 62 LoadParam<GLMenuImageScreen>(root, "BackgroundPS", this, &GLMenuImageScreen::setPosScale) 63 .describe("The Position and Scale of the Background Image in %(0-1.0). PosX, PosY, SizeX, SizeY"); 64 65 LoadParam<GLMenuImageScreen>(root, "BarImage", this, &GLMenuImageScreen::setBarImage) 66 .describe("sets the image of the LoadingBar"); 67 68 LoadParam<GLMenuImageScreen>(root, "BarPS", this, &GLMenuImageScreen::setBarPosScale) 69 .describe("The Position and Scale of the Loading Bar in %(0-1.0). PosX, PosY, SizeX, SizeY"); 70 71 LoadParam<GLMenuImageScreen>(root, "ElementCount", this, &GLMenuImageScreen::setMaximum) 72 .describe("The Count of elements to load into the bar (this is only a maximum value)"); 90 73 } 91 74 … … 149 132 this->scaleX = scaleX; 150 133 this->scaleY = scaleY; 134 } 135 136 /* 137 \brief sets position and size of the ImageScreen 138 \param x offset from the top left corner in percent(0-1) of the screensize 139 \param y offset from the top left corner in percent(0-1) of the screensize 140 \param scaleX the scaleing of the image into the x-direction (in percent (0-1)) 141 \param scaleY the scaleing of the image into the y-direction (in percent (0-1)) 142 */ 143 void GLMenuImageScreen::setPosScale(float offsetX, float offsetY, float scaleX, float scaleY) 144 { 145 this->setPosition(offsetX, offsetY); 146 this->setScale(scaleX, scaleY); 151 147 } 152 148 -
orxonox/trunk/src/glmenu/glmenu_imagescreen.h
r4104 r4261 17 17 public: 18 18 GLMenuImageScreen (); 19 GLMenuImageScreen ( TiXmlElement* root);20 void load (TiXmlElement* root);19 GLMenuImageScreen (const TiXmlElement* root); 20 void loadParams(const TiXmlElement* root); 21 21 virtual ~GLMenuImageScreen (); 22 22 … … 28 28 void setPosition(float offsetX, float offsetY); 29 29 void setScale (float scaleX, float scaleY); 30 void setPosScale(float offsetX, float offsetY, float scaleX, float scaleY); 30 31 31 32 void setBarImage(const char* barImage);
Note: See TracChangeset
for help on using the changeset viewer.