Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7062 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Feb 6, 2006, 9:55:04 PM (19 years ago)
Author:
bensch
Message:

hud

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl_gui/glgui_bar.cc

    r6305 r7062  
    4545  this->setClassID(CL_GLGUI_BAR, "GLGuiBar");
    4646
    47   this->frontMat.setDiffuse(1,0,0);
    48   this->frontMat.setTransparency(.99);
     47  this->frontMat.setDiffuse(1,1,1);
    4948
    5049  this->setSize2D(50, 10);
     
    6766  glBegin(GL_QUADS);
    6867
     68  glTexCoord2i(0,0);
    6969  glVertex2f(3.0, 3.0);
     70  glTexCoord2i(0,1);
    7071  glVertex2f(3.0, (this->getSizeY2D()-3.0)* (value/maximum));
     72  glTexCoord2i(1,1);
    7173  glVertex2f(this->getSizeX2D()-3.0, (this->getSizeY2D()-3.0) * (value/maximum));
     74  glTexCoord2i(1,0);
    7275  glVertex2f(this->getSizeX2D()-3.0, 3.0);
    7376
  • trunk/src/lib/gui/gl_gui/glgui_widget.cc

    r6431 r7062  
    5454//  this->setParent2D((Element2D*)NULL);
    5555
    56   this->backMat.setDiffuse(.1, .5, .5);
    57   this->backMat.setTransparency(.9);
     56  this->backMat.setDiffuse(1.0, 1.0, 1.0);
    5857
    5958  this->frontModel = 0;
     
    118117
    119118  glBegin(GL_QUADS);
    120    glVertex2d(0, 0);
    121    glVertex2d(0, this->getSizeY2D());
    122    glVertex2d(this->getSizeX2D(), this->getSizeY2D());
    123    glVertex2d(this->getSizeX2D(), 0);
     119   glTexCoord2i(0,1); glVertex2d(0, 0);
     120   glTexCoord2i(0,0); glVertex2d(0, this->getSizeY2D());
     121   glTexCoord2i(1,0); glVertex2d(this->getSizeX2D(), this->getSizeY2D());
     122   glTexCoord2i(1,1); glVertex2d(this->getSizeX2D(), 0);
    124123  glEnd();
    125124}
  • trunk/src/lib/gui/gl_gui/glgui_widget.h

    r6438 r7062  
    6666    virtual void draw() const;
    6767
     68    Material& backMaterial() { return this->backMat; };
     69    Material& frontMaterial() { return this->frontMat; };
     70
    6871  protected:
    6972    inline void startDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };
  • trunk/src/util/hud.cc

    r6756 r7062  
    7474  {
    7575    this->energyWidget->show();
     76    this->energyWidget->backMaterial().setDiffuseMap("hud_energy_background.png");
     77    this->energyWidget->backMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     78    this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
     79    this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    7680  }
    7781
     
    146150  if (this->energyWidget != NULL)
    147151  {
    148     this->energyWidget->setAbsCoor2D(.02 * this->resX, .4 * this->resY);
    149     this->energyWidget->setSize2D(.05 * this->resX, .55 * this->resY);
     152    this->energyWidget->setAbsCoor2D(0 * this->resX, 0 * this->resY);
     153    this->energyWidget->setSize2D(.3 * this->resX, 1 * this->resY);
    150154  }
    151155
     
    171175void Hud::draw() const
    172176{
    173   GLGuiWidget::draw();
     177//  GLGuiWidget::draw();
    174178}
    175179
  • trunk/src/util/hud.h

    r6512 r7062  
    4141  private:
    4242    void updateResolution();
     43
    4344private:
    4445  unsigned int             resX;
Note: See TracChangeset for help on using the changeset viewer.