Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4261 in orxonox.OLD for orxonox/trunk/src/glmenu


Ignore:
Timestamp:
May 22, 2005, 3:19:57 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the levelLoader-branche back into the trunk, because it seems to be stable.
merged with command:
svn merge -r 4230:HEAD levelLoader ../trunk
no conflicts of any interesst

Location:
orxonox/trunk/src/glmenu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.cc

    r4136 r4261  
    1919#include "glmenu_imagescreen.h"
    2020
    21 #include "stdincl.h"
    2221#include "graphics_engine.h"
    2322#include "material.h"
     23#include "factory.h"
    2424
    2525CREATE_FACTORY(GLMenuImageScreen);
     
    3838   \param root The Element to load the GLMenu from
    3939*/
    40 GLMenuImageScreen::GLMenuImageScreen (TiXmlElement* root)
     40GLMenuImageScreen::GLMenuImageScreen(const TiXmlElement* root)
    4141{
    4242  this->init();
    43   this->load(root);
    44 
     43  this->loadParams(root);
    4544}
    4645
     
    5655   \li ElementCount: INT: how many elements will be loaded
    5756*/
    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));
     57void 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)");
    9073}
    9174
     
    149132  this->scaleX = scaleX;
    150133  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*/
     143void GLMenuImageScreen::setPosScale(float offsetX, float offsetY, float scaleX, float scaleY)
     144{
     145  this->setPosition(offsetX, offsetY);
     146  this->setScale(scaleX, scaleY);
    151147}
    152148
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.h

    r4104 r4261  
    1717 public:
    1818  GLMenuImageScreen ();
    19   GLMenuImageScreen (TiXmlElement* root);
    20   void load(TiXmlElement* root);
     19  GLMenuImageScreen (const TiXmlElement* root);
     20  void loadParams(const TiXmlElement* root);
    2121  virtual ~GLMenuImageScreen ();
    2222
     
    2828  void setPosition(float offsetX, float offsetY);
    2929  void setScale (float scaleX, float scaleY);
     30  void setPosScale(float offsetX, float offsetY, float scaleX, float scaleY);
    3031
    3132  void setBarImage(const char* barImage);
Note: See TracChangeset for help on using the changeset viewer.