- Timestamp:
- May 31, 2006, 2:03:21 AM (18 years ago)
- Location:
- branches/gui/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl_gui/glgui_image.cc
r8009 r8010 54 54 void GLGuiImage::loadImageFromTexture(const Texture& texture) 55 55 { 56 this->texture = texture; 56 this->frontMaterial().setDiffuseMap(texture); 57 this->frontMaterial().setDiffuse(1,1,1); 57 58 } 58 59 … … 74 75 void GLGuiImage::resize() 75 76 { 76 this->frontRect().setTopLeft( 1, 1);77 this->frontRect().setSize(this->getSizeX2D() -2 , this->getSizeY2D() -2);77 this->frontRect().setTopLeft(this->borderSize(), this->borderSize()); 78 this->frontRect().setSize(this->getSizeX2D() -2.0*this->borderSize(), this->getSizeY2D() - 2.0* this->borderSize() ); 78 79 GLGuiWidget::resize(); 79 80 } … … 91 92 this->drawRect(this->frontRect()); 92 93 this->endDraw(); 93 94 95 94 } 96 95 } -
branches/gui/src/lib/gui/gl_gui/glgui_text.h
r7779 r8010 26 26 virtual ~GLGuiText(); 27 27 28 void setText(); 29 30 virtual void draw(); 31 32 private: 28 33 void init(); 29 34 30 virtual void draw();31 35 32 36 private: -
branches/gui/src/story_entities/simple_game_menu.cc
r8009 r8010 114 114 box->showAll(); 115 115 116 OrxGui::GLGuiImage* image = new OrxGui::GLGuiImage(); 117 image->show(); 118 image->loadImageFromFile( "death_screen.png" ); 119 image->setWidgetSize(200, 200); 120 image->setAbsCoor2D(300, 300); 121 122 OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider(); 123 slider->connect(SIGNAL(slider, valueChanged), box, SLOT(Element2D, setRelCoorX2D)); 124 slider->setRange(100, 500); 125 slider->setStep(50); 126 slider->setValue(slider->min()); 127 slider->show(); 128 slider->setAbsCoor2D(100, 00); 116 117 OrxGui::GLGuiBox* imageSelector = new OrxGui::GLGuiBox(); 118 { 119 120 image = new OrxGui::GLGuiImage(); 121 image->show(); 122 image->loadImageFromFile( "death_screen.png" ); 123 image->setWidgetSize(200, 200); 124 image->setAbsCoor2D(300, 300); 125 imageSelector->pack(image); 126 127 imageName = new OrxGui::GLGuiInputLine(); 128 imageSelector->pack(imageName); 129 130 OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider(); 131 slider->connect(SIGNAL(slider, valueChanged), this, SLOT(SimpleGameMenu, setImage)); 132 133 slider->setRange(0, 100); 134 slider->setStep(50); 135 slider->setValue(slider->min()); 136 imageSelector->pack(slider); 137 } 138 imageSelector->showAll(); 139 imageSelector->setAbsCoor2D(400, 30); 140 129 141 130 142 ///// 143 } 144 145 146 #include "class_list.h" 147 void SimpleGameMenu::setImage(int i) 148 { 149 const std::list<BaseObject*>* textures = ClassList::getList(CL_TEXTURE); 150 151 if(textures && textures->size() > i) 152 { 153 std::list<BaseObject*>::const_iterator test = textures->begin(); 154 while (--i > 0) 155 { 156 test++; 157 } 158 this->image->loadImageFromTexture(*dynamic_cast<Texture*>(*test)); 159 this->imageName->setText((*test)->getName()); 160 } 131 161 } 132 162 -
branches/gui/src/story_entities/simple_game_menu.h
r7985 r8010 16 16 17 17 #include "elements/text_element.h" 18 19 #include "glgui.h" 18 20 19 21 class SimpleGameMenuData; … … 53 55 void execURL() const; 54 56 static int startURL(void* data); 57 58 void setImage(int i); 59 OrxGui::GLGuiImage* image; 60 OrxGui::GLGuiInputLine* imageName; 55 61 /// 56 62 virtual void loadParams(const TiXmlElement* root);
Note: See TracChangeset
for help on using the changeset viewer.