- Timestamp:
- Jan 9, 2007, 11:03:38 PM (18 years ago)
- 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 21 21 #include <iostream> 22 22 #include "math.h" 23 #include "glgui_image.h" 23 24 24 25 namespace OrxGui … … 43 44 44 45 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); 49 59 50 60 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); 53 64 this->_valueText.setChangedTextColor(Color::white); 54 65 55 66 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 58 75 59 76 //this->_name.setBackgroundTexture(Texture()); … … 66 83 this->_bar.setForegroundColor(Color(.5, .5, .5, 1)); 67 84 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); 70 92 } 71 93 … … 86 108 { 87 109 MultiType val(value); 110 //MultiType val(200.00); 88 111 val.setType(MT_INT); 89 112 … … 94 117 this->_valueText.setText(val.getString()); 95 118 //this->_valueText.setText("asdfas"); 119 } 120 121 void GLGuiEnergyWidgetVertical::setDisplayedImage(const std::string& imageName) 122 { 123 this->_image.loadImageFromFile(imageName); 96 124 } 97 125 … … 107 135 this->_valueText.show(); 108 136 this->_bar.show(); 137 //this->show(); 109 138 } 110 139 -
branches/playability/src/world_entities/elements/glgui_energywidgetvertical.h
r10194 r10200 7 7 #define _GLGUI_ENERGY_WIDGET_VERTICAL_H 8 8 9 #include "glgui_box.h"9 //#include "glgui_box.h" 10 10 #include "glgui_bar.h" 11 11 #include "glgui_text.h" 12 #include "glgui_ widget.h"12 #include "glgui_image.h" 13 13 14 14 namespace OrxGui … … 25 25 void setMaximum(float max); 26 26 void setValue(float value); 27 void setDisplayedImage(const std::string& imageName); 27 28 28 29 inline GLGuiWidget* getImageWidget() {return &this->_image;}; … … 36 37 37 38 private: 38 GLGui Widget_image;39 GLGuiImage _image; 39 40 GLGuiText _valueText; 40 41 GLGuiBar _bar;
Note: See TracChangeset
for help on using the changeset viewer.