Changeset 8378 in orxonox.OLD for branches/gui
- Timestamp:
- Jun 14, 2006, 12:31:32 PM (19 years ago)
- Location:
- branches/gui/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl/glgui_bar.cc
r8145 r8378 46 46 this->setClassID(CL_GLGUI_BAR, "GLGuiBar"); 47 47 48 this->front Material().setDiffuse(1,1,1);48 this->frontColor().setColor(1,1,1); 49 49 50 50 this->setSize2D(50, 10); … … 64 64 GLGuiWidget::draw(); 65 65 66 this->frontMaterial().select();66 //this->frontMaterial().select(); 67 67 glBegin(GL_QUADS); 68 68 -
branches/gui/src/lib/gui/gl/glgui_button.cc
r8145 r8378 55 55 56 56 this->_label.setFont("fonts/final_frontier.ttf", 20); 57 this->front Material().setDiffuse(1, 0,0);57 this->frontColor().setColor(1, 0, 0, 1.0); 58 58 59 59 this->_label.setParent2D(this); -
branches/gui/src/lib/gui/gl/glgui_checkbutton.cc
r8145 r8378 68 68 this->setSize2D(this->labelText().getSizeX2D() + 30 + borderLeft() + borderRight(), this->labelText().getSizeY2D() + 10 + borderTop()+borderBottom()); 69 69 GLGuiWidget::resize(); 70 this->frontRect().setTopLeft(borderLeft(), borderTop());71 this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()) , this->getSizeY2D() - (borderTop() + borderBottom())); 70 /* this->frontRect().setTopLeft(borderLeft(), borderTop()); 71 this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()) , this->getSizeY2D() - (borderTop() + borderBottom()));*/ 72 72 } 73 73 … … 89 89 GLGuiButton::draw(); 90 90 91 this->frontMaterial().select();92 this->drawRect(this->frontRect());91 // this->frontMaterial().select(); 92 // this->drawRect(this->frontRect()); 93 93 94 94 if (this->bActive) -
branches/gui/src/lib/gui/gl/glgui_image.cc
r8145 r8378 45 45 this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage"); 46 46 47 this->frontMaterial().setDiffuseMap(this->texture);48 this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);47 // this->frontMaterial().setDiffuseMap(this->texture); 48 // this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 49 49 50 50 this->resize(); … … 54 54 void GLGuiImage::loadImageFromTexture(const Texture& texture) 55 55 { 56 this->frontMaterial().setDiffuseMap(texture);57 this->frontMaterial().setDiffuse(1,1,1); 56 /* this->frontMaterial().setDiffuseMap(texture); 57 this->frontMaterial().setDiffuse(1,1,1);*/ 58 58 } 59 59 … … 75 75 void GLGuiImage::resize() 76 76 { 77 this->frontRect().setTopLeft(this->borderLeft(), this->borderTop());78 this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) ); 77 /* this->frontRect().setTopLeft(this->borderLeft(), this->borderTop()); 78 this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) );*/ 79 79 GLGuiWidget::resize(); 80 80 } … … 89 89 GLGuiWidget::draw(); 90 90 91 this->frontMaterial().select(); 92 this->drawRect(this->frontRect()); 91 /* this->frontMaterial().select();*/ 92 /* this->drawRect(this->frontRect());*/ 93 93 this->endDraw(); 94 94 } -
branches/gui/src/lib/gui/gl/glgui_inputline.cc
r8145 r8378 167 167 this->setSize2D( this->text.getSize2D() + Vector2D(borderLeft() + borderRight() + 4.0, borderTop() + borderBottom() + 4.0)); 168 168 GLGuiWidget::resize(); 169 this->frontRect().setTopLeft(borderLeft(), borderTop());170 this->frontRect().setSize(this->getSize2D() - Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom())); 169 /* this->frontRect().setTopLeft(borderLeft(), borderTop()); 170 this->frontRect().setSize(this->getSize2D() - Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));*/ 171 171 } 172 172 … … 218 218 GLGuiWidget::draw(); 219 219 220 this->frontMaterial().select();221 GLGuiWidget::drawRect(this->frontRect());220 // this->frontMaterial().select(); 221 // GLGuiWidget::drawRect(this->frontRect()); 222 222 223 223 this->endDraw(); -
branches/gui/src/lib/gui/gl/glgui_pushbutton.cc
r8145 r8378 49 49 50 50 GLGuiWidget::resize(); 51 this->frontRect().setTopLeft(borderLeft(), borderTop());52 this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom())); 51 /* this->frontRect().setTopLeft(borderLeft(), borderTop()); 52 this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()));*/ 53 53 } 54 54 … … 97 97 GLGuiButton::draw(); 98 98 99 this->frontMaterial().select();100 this->drawRect(this->frontRect());101 99 this->endDraw(); 102 100 // this->label->draw(); -
branches/gui/src/lib/gui/gl/glgui_slider.cc
r8335 r8378 161 161 { 162 162 GLGuiWidget::resize(); 163 this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0);164 this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0); 163 /* this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0); 164 this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);*/ 165 165 } 166 166 … … 228 228 GLGuiWidget::draw(); 229 229 230 this->frontMaterial().select();231 this->drawRect(this->frontRect());230 //this->frontMaterial().select(); 231 // this->drawRect(this->frontRect()); 232 232 233 233 this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, 0*this->borderTop(), _sliderWidth, this->getSizeY2D() - (borderTop() + borderBottom()) )); -
branches/gui/src/lib/gui/gl/glgui_textfield.cc
r8145 r8378 53 53 GLGuiWidget::draw(); 54 54 55 this->frontMaterial().select();56 this->drawRect(this->frontRect()); 55 /* this->frontMaterial().select(); 56 this->drawRect(this->frontRect());*/ 57 57 this->endDraw(); 58 58 } -
branches/gui/src/lib/gui/gl/glgui_widget.cc
r8335 r8378 67 67 68 68 this->_backMat.setDiffuse(1.0, 1.0, 1.0); 69 this->_front Mat.setDiffuse(1.0, 0.0, 0.0);69 this->_frontColor.setColor(1.0, 0.0, 0.0); 70 70 71 71 this->_borderLeft = 1.0; … … 176 176 void GLGuiWidget::clicking(const Vector2D& pos) 177 177 { 178 this->front Material().setDiffuse(0, 0, 1);178 this->frontColor().setColor(0, 0, 1); 179 179 180 180 } … … 182 182 void GLGuiWidget::releasing(const Vector2D& pos) 183 183 { 184 this->front Material().setDiffuse(0,1,0);184 this->frontColor().setColor(0,1,0); 185 185 186 186 } … … 188 188 void GLGuiWidget::receivedFocus() 189 189 { 190 this->front Material().setDiffuse(0, 1, 0);190 this->frontColor().setColor(0, 1, 0); 191 191 } 192 192 193 193 void GLGuiWidget::removedFocus() 194 194 { 195 this->front Material().setDiffuse(1, 0, 0);195 this->frontColor().setColor(1, 0, 0); 196 196 197 197 } -
branches/gui/src/lib/gui/gl/glgui_widget.h
r8312 r8378 92 92 const Rect2D& backRect() const { return this->_backRect; }; 93 93 94 Material& frontMaterial() { return this->_frontMat; }; 95 const Material& frontMaterial() const { return this->_frontMat; }; 96 Rect2D& frontRect() { return this->_frontRect; }; 97 const Rect2D& frontRect() const { return this->_frontRect; }; 94 Color& frontColor() { return this->_frontColor; }; 95 const Color& frontColor() const { return this->_frontColor; }; 98 96 99 97 /** @brief sets all borders to the same value. */ … … 162 160 Rect2D _backRect; 163 161 164 Material _frontMat; 165 Rect2D _frontRect; 162 Color _frontColor; 166 163 167 164 float _borderLeft; -
branches/gui/src/lib/util/color.h
r8376 r8378 16 16 { 17 17 public: 18 Color(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 0.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; };18 Color(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; }; 19 19 Color(const Color& c) { _rgba[0] = c.r(); _rgba[1] = c.g(); _rgba[2] = c.b(); _rgba[3] = c.a(); } 20 20 21 float& operator[](unsigned int i) { return _rgba[i]; }22 const float& operator[](unsigned int i) const { return _rgba[i]; }21 inline float& operator[](unsigned int i) { return _rgba[i]; } 22 inline const float& operator[](unsigned int i) const { return _rgba[i]; } 23 23 24 float r() const { return _rgba[0]; } 25 float& r() { return _rgba[0]; } 26 float g() const { return _rgba[1]; } 27 float& g() { return _rgba[1]; } 28 float b() const { return _rgba[2]; } 29 float& b() { return _rgba[2]; } 30 float a() const { return _rgba[3]; } 31 float& a() { return _rgba[3]; } 24 inline float r() const { return _rgba[0]; } 25 inline float& r() { return _rgba[0]; } 26 inline float g() const { return _rgba[1]; } 27 inline float& g() { return _rgba[1]; } 28 inline float b() const { return _rgba[2]; } 29 inline float& b() { return _rgba[2]; } 30 inline float a() const { return _rgba[3]; } 31 inline float& a() { return _rgba[3]; } 32 33 void setColor(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; }; 32 34 33 35 -
branches/gui/src/util/hud.cc
r8145 r8378 76 76 this->energyWidget->backMaterial().setDiffuseMap("hud_energy_background.png"); 77 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); 78 /* this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png"); 79 this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/ 80 80 } 81 81 … … 132 132 weapon->getEnergyWidget()->backMaterial().setDiffuse( .8,.2,.11); 133 133 weapon->getEnergyWidget()->backMaterial().setTransparency(.1); 134 weapon->getEnergyWidget()->front Material().setDiffuse( .2,.5,.7);135 weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);134 weapon->getEnergyWidget()->frontColor().setColor( .2,.5,.7,.6); 135 // weapon->getEnergyWidget()->frontMaterial().setTransparency(.6); 136 136 this->weaponsWidgets.push_back(weapon->getEnergyWidget()); 137 137 }
Note: See TracChangeset
for help on using the changeset viewer.