Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8980 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Jul 1, 2006, 3:18:43 PM (18 years ago)
Author:
bensch
Message:

trunk: more gui in the Hud

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/text_engine/limited_width_text.h

    r8619 r8980  
    2626    // Setup:
    2727    void setLineWidth(float lineWidth);
    28     void setDotsPosition(DotsPosition dotsPosition);
     28    void setDotsPosition(LimitedWidthText::DotsPosition dotsPosition);
    2929
    3030    // Retrieve:
  • trunk/src/lib/gui/gl/glgui_text.cc

    r8973 r8980  
    4848    this->_text.setRelCoor2D(4,4);
    4949    this->_text.setFont("fonts/final_frontier.ttf", 20);
     50    this->_text.setLineWidth(400);
     51    this->_text.setDotsPosition(LimitedWidthText::Begin);
    5052    this->_text.setColor(foregroundColor());
    5153    this->_text.setVisibility(false);
     
    122124    this->_text.setRelCoor2D(borderLeft(), borderTop());
    123125    this->setSize2D( this->_text.getSize2D() + Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));
     126    //this->_text.setLineWidth(this->size2D);
    124127    GLGuiWidget::resize();
    125128    /*    this->frontRect().setTopLeft(borderLeft(), borderTop());
  • trunk/src/lib/gui/gl/glgui_text.h

    r8973 r8980  
    99
    1010#include "glgui_widget.h"
    11 #include "text.h"
     11#include "limited_width_text.h"
    1212// FORWARD DECLARATION
    1313namespace OrxGui
     
    3131    void clear();
    3232
     33    void setDotsPosition(LimitedWidthText::DotsPosition dotsPosition) { this->_text.setDotsPosition(dotsPosition); };
     34
    3335    const std::string& text() const { return _text.text(); };
    3436
     
    5052
    5153  private:
    52     Text              _text;
     54    LimitedWidthText    _text;
    5355  };
    5456}
  • trunk/src/world_entities/elements/glgui_energywidget.cc

    r8977 r8980  
    2727  {
    2828    //   this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget");
     29    this->pack(&this->_name);
     30    this->pack(&this->_valueText);
     31    this->pack(&this->_bar);
    2932
    30     this->pack(&this->name);
    31     this->pack(&this->text);
    32     this->pack(&this->bar);
     33    this->setBackgroundTexture("maps/gui_element_background_2.png");
     34    this->setBackgroundColor(Color(.5,.5,.5,1));
     35
     36    this->_name.setBackgroundTexture(Texture());
     37    this->_valueText.setBackgroundTexture("maps/gui_element_background_2.png");
     38    this->_valueText.setBackgroundTexture("maps/gui_element_background_2.png");
     39    this->_bar.setBackgroundTexture(Texture());
    3340  }
    3441
     
    4552  void GLGuiEnergyWidget::setDisplayedName(const std::string& name)
    4653  {
    47     this->name.setText(name);
     54    this->_name.setText(name);
    4855  }
    4956
    5057  void GLGuiEnergyWidget::setMaximum(float max)
    5158  {
    52     this->bar.setMaximum(max);
     59    this->_bar.setMaximum(max);
    5360  }
    5461
     
    5865    val.setType(MT_INT);
    5966
    60     this->bar.setValue(value);
    61     this->text.setText(val.getString());
     67    this->_bar.setValue(value);
     68    this->_valueText.setText(val.getString());
    6269  }
    6370
     
    6572  void GLGuiEnergyWidget::showing()
    6673  {
    67     this->name.show();
    68     this->text.show();
    69     this->bar.show();
     74    this->_name.show();
     75    this->_valueText.show();
     76    this->_bar.show();
    7077  }
    7178
    7279  void GLGuiEnergyWidget::hiding()
    7380  {
    74     this->name.hide();
    75     this->text.hide();
    76     this->bar.hide();
     81    this->_name.hide();
     82    this->_valueText.hide();
     83    this->_bar.hide();
    7784  }
    7885}
  • trunk/src/world_entities/elements/glgui_energywidget.h

    r8977 r8980  
    3232
    3333  private:
    34     GLGuiText               name;
    35     GLGuiBar                bar;
    36     GLGuiText               text;
     34    GLGuiText               _name;
     35    GLGuiBar                _bar;
     36    GLGuiText               _valueText;
    3737
    3838  };
Note: See TracChangeset for help on using the changeset viewer.