Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8972 in orxonox.OLD


Ignore:
Timestamp:
Jul 1, 2006, 11:26:00 AM (18 years ago)
Author:
bensch
Message:

added glgui_energywidget, the new Widget to display Energy and a Value

Location:
trunk/src
Files:
6 edited
2 copied

Legend:

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

    r8448 r8972  
    5555  }
    5656
     57  void GLGuiBar::resize()
     58  {
     59    GLGuiWidget::resize();
     60
     61
     62  }
     63
     64
    5765  /**
    5866   * @brief draws the GLGuiBar
     
    6068  void GLGuiBar::draw() const
    6169  {
     70    printf("BAR\n");
    6271    this->beginDraw();
    63 
    6472    GLGuiWidget::draw();
    6573
    66     //this->frontMaterial().select();
    67     glBegin(GL_QUADS);
    68 
    69     glTexCoord2f(0,0);
    70     glVertex2f(3.0, 3.0);
    71     glTexCoord2f(0, value/maximum);
    72     glVertex2f(3.0, (this->getSizeY2D()-3.0)* (value/maximum));
    73     glTexCoord2f(1, value/maximum);
    74     glVertex2f(this->getSizeX2D()-3.0, (this->getSizeY2D()-3.0) * (value/maximum));
    75     glTexCoord2f(1,0);
    76     glVertex2f(this->getSizeX2D()-3.0, 3.0);
    77 
    78     glEnd();
    7974    this->endDraw();
    8075  }
  • trunk/src/lib/gui/gl/glgui_bar.h

    r8145 r8972  
    3737    virtual void draw() const;
    3838
     39  protected:
     40    virtual void resize();
     41
    3942  private:
    4043    void init();
  • trunk/src/lib/gui/gl/glgui_text.h

    r8145 r8972  
    99
    1010#include "glgui_widget.h"
    11 
     11#include "text.h"
    1212// FORWARD DECLARATION
    13 class Text;
    1413namespace OrxGui
    1514{
     
    1918   *
    2019   */
    21   class GLGuiText : public GLWidget
     20  class GLGuiText : public GLGuiWidget
    2221  {
    2322
     
    3534
    3635  private:
    37     Text*             text;
     36    Text              text;
    3837  };
    3938}
  • trunk/src/util/hud.h

    r8518 r8972  
    1919}
    2020
    21 //! A class that renders a HUD.
     21//! A class that renders a HUD (Heads Up Display for User Information).
    2222class Hud : public Element2D
    2323{
  • trunk/src/world_entities/Makefile.am

    r8255 r8972  
    2929                \
    3030                effects/explosion.cc \
    31                 effects/billboard.cc
     31                effects/billboard.cc \
     32                \
     33                \
     34                elements/glgui_energywidget.cc
    3235
    3336
     
    5962                effects/billboard.h \
    6063                \
     64                \
     65                \
     66                elements/glgui_energywidget.h \
    6167                $(WorldEntities_HEADERS_)
    6268
  • trunk/src/world_entities/elements/glgui_energywidget.cc

    r8970 r8972  
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "glgui_energywidget.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
     22  /**
     23   * @brief standard constructor
     24   * @todo this constructor is not jet implemented - do it
     25  */
     26  GLGuiEnergyWidget::GLGuiEnergyWidget ()
     27  {
     28    //   this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget");
     29  }
    2130
    2231
    23 /**
    24  * standard constructor
    25  * @todo this constructor is not jet implemented - do it
    26 */
    27 ProtoClass::ProtoClass ()
    28 {
    29    this->setClassID(CL_PROTO_ID, "ProtoClass");
    30 
    31    /* If you make a new class, what is most probably the case when you write this file
    32       don't forget to:
    33        1. Add the new file new_class.cc to the ./src/Makefile.am
    34        2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS
    35 
    36       Advanced Topics:
    37       - if you want to let your object be managed via the ObjectManager make sure to read
    38         the object_manager.h header comments. You will use this most certanly only if you
    39         make many objects of your class, like a weapon bullet.
     32  /**
     33   * @brief standard deconstructor
    4034   */
     35  GLGuiEnergyWidget::~GLGuiEnergyWidget ()
     36  {
     37    // delete what has to be deleted here
     38  }
    4139}
    42 
    43 
    44 /**
    45  * standard deconstructor
    46 */
    47 ProtoClass::~ProtoClass ()
    48 {
    49   // delete what has to be deleted here
    50 }
  • trunk/src/world_entities/elements/glgui_energywidget.h

    r8970 r8972  
    11/*!
    2  * @file proto_class.h
    3  * @brief Definition of ...
     2 * @file glgui_energywidget.h
     3 * @brief Definition of an EnergyWidget, that displays a bar and a Text
    44*/
    55
    6 #ifndef _PROTO_CLASS_H
    7 #define _PROTO_CLASS_H
     6#ifndef _GLGUI_ENERGY_WIDGET_H
     7#define _GLGUI_ENERGY_WIDGET_H
    88
    9 #include "base_object.h"
     9#include "glgui_widget.h"
     10#include "glgui_bar.h"
     11#include "glgui_text.h"
    1012
    11 // FORWARD DECLARATION
     13namespace OrxGui
     14{
     15
     16  //! A class for ...
     17  class GLGuiEnergyWidget : public GLGuiWidget
     18  {
     19
     20    public:
     21    GLGuiEnergyWidget();
     22    virtual ~GLGuiEnergyWidget();
    1223
    1324
     25    private:
     26      GLGuiBar                bar;
     27      GLGuiText               text;
    1428
    15 //! A class for ...
    16 class ProtoClass : public BaseObject {
    17 
    18  public:
    19   ProtoClass();
    20   virtual ~ProtoClass();
    21 
    22 
    23  private:
    24 
    25 };
    26 
    27 #endif /* _PROTO_CLASS_H */
     29  };
     30}
     31#endif /* _GLGUI_ENERGY_WIDGET_H */
  • trunk/src/world_entities/world_entity.cc

    r8894 r8972  
    4141#include "kill.h"
    4242
    43 #include <stdarg.h>
    44 
    45 
    46 using namespace std;
    4743
    4844SHELL_COMMAND(model, WorldEntity, loadModel)
Note: See TracChangeset for help on using the changeset viewer.