Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 9, 2007, 11:03:38 PM (18 years ago)
Author:
muellmic
Message:

changed style of vertical gui-element. textures still need to be done, though

Location:
branches/playability/src/world_entities/elements
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/elements/glgui_energywidgetvertical.cc

    r10194 r10200  
    2121#include <iostream>
    2222#include "math.h"
     23#include "glgui_image.h"
    2324
    2425namespace OrxGui
     
    4344
    4445    this->_image.setParent2D(this);
    45     this->_image.setSize2D(20,20);
    46     this->_image.setBackgroundColor(Color(1,1,1,.8));
    47     this->_image.setBackgroundTexture("maps/TE2.png");
    48     this->_image.setRelCoor2D(borderLeft(), borderTop() + this->_bar.getSizeX2D());
     46    this->_image.setBorderTop(0);
     47    this->_image.setBorderLeft(0);
     48    this->_image.setBorderRight(0);
     49    this->_image.setBorderBottom(0);
     50    this->_image.setWidgetSize(30,30);
     51    this->_image.setForegroundColor(Color(1,1,1,0.6));
     52    this->_image.setBackgroundColor(Color(1,1,1,0));
     53    this->_image.setBackgroundTexture(Texture());
     54    this->_image.loadImageFromFile("maps/evil-flower.png");
     55    //this->_image.setRelCoor2D(borderLeft(), borderTop() + this->_bar.getSizeX2D());
     56    this->_image.setRelCoor2D(0,0);
     57    this->_image.setRelDir2D(90);
     58    this->_image.setVisibility(true);
    4959
    5060    this->_valueText.setParent2D(this);
    51     this->_valueText.setSize2D(100,20);
    52     this->_valueText.setRelCoor2D(borderLeft(), borderTop() + this->_bar.getSizeX2D());
     61    this->_valueText.setWidgetSize(100,20);
     62    //this->_valueText.setRelCoor2D(borderLeft(), borderTop() + this->_bar.getSizeX2D());
     63    this->_valueText.setRelCoor2D(0,0);
    5364    this->_valueText.setChangedTextColor(Color::white);
    5465
    5566    this->setBackgroundTexture(Texture());
    56     this->setBackgroundColor(Color(.5,.5,.5,0));
    57     this->setSize2D(120,20);
     67    this->setBackgroundColor(Color(1,1,1,0.5));
     68    this->setBorderTop(10);
     69    this->setBorderLeft(10);
     70    this->setBorderRight(10);
     71    this->setBorderBottom(10);
     72    this->setWidgetSize(120,50);
     73    this->setVisibility(true);
     74   
    5875
    5976    //this->_name.setBackgroundTexture(Texture());
     
    6683    this->_bar.setForegroundColor(Color(.5, .5, .5, 1));
    6784    this->_bar.setChangedValueColor(Color::black);
    68     this->_bar.setSize2D(100,20);
    69     this->_bar.setRelCoor2D(borderLeft(), 0);
     85    this->_bar.setBorderTop(0);
     86    this->_bar.setBorderLeft(0);
     87    this->_bar.setBorderRight(0);
     88    this->_bar.setBorderBottom(0);
     89    this->_bar.setWidgetSize(100,30);
     90    //this->_bar.setRelCoor2D(borderLeft(), 0);
     91    this->_bar.setRelCoor2D(0,0);
    7092  }
    7193
     
    86108  {
    87109    MultiType val(value);
     110    //MultiType val(200.00);
    88111    val.setType(MT_INT);
    89112
     
    94117    this->_valueText.setText(val.getString());
    95118    //this->_valueText.setText("asdfas");
     119  }
     120
     121  void GLGuiEnergyWidgetVertical::setDisplayedImage(const std::string& imageName)
     122  {
     123    this->_image.loadImageFromFile(imageName);
    96124  }
    97125
     
    107135    this->_valueText.show();
    108136    this->_bar.show();
     137    //this->show();
    109138  }
    110139
  • branches/playability/src/world_entities/elements/glgui_energywidgetvertical.h

    r10194 r10200  
    77#define _GLGUI_ENERGY_WIDGET_VERTICAL_H
    88
    9 #include "glgui_box.h"
     9//#include "glgui_box.h"
    1010#include "glgui_bar.h"
    1111#include "glgui_text.h"
    12 #include "glgui_widget.h"
     12#include "glgui_image.h"
    1313
    1414namespace OrxGui
     
    2525    void setMaximum(float max);
    2626    void setValue(float value);
     27    void setDisplayedImage(const std::string& imageName);
    2728
    2829    inline GLGuiWidget* getImageWidget() {return &this->_image;};
     
    3637
    3738  private:
    38     GLGuiWidget             _image;
     39    GLGuiImage             _image;
    3940    GLGuiText               _valueText;
    4041    GLGuiBar                _bar;
Note: See TracChangeset for help on using the changeset viewer.