Changeset 1993 for code/branches/objecthierarchy/src/orxonox/overlays
- Timestamp:
- Oct 22, 2008, 5:25:01 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/overlays
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/overlays/OverlayGroup.cc
r1854 r1993 100 100 } 101 101 else 102 { 102 103 hudElements_[element->getName()] = element; 104 element->setVisible(this->isVisible()); 105 } 103 106 } 104 107 -
code/branches/objecthierarchy/src/orxonox/overlays/OverlayText.cc
r1784 r1993 31 31 32 32 #include <OgreOverlayManager.h> 33 #include <OgreTextAreaOverlayElement.h>34 33 #include <OgrePanelOverlayElement.h> 35 34 … … 68 67 69 68 XMLPortParam(OverlayText, "font", setFont, getFont, xmlElement, mode).defaultValues("Monofur"); 69 XMLPortParam(OverlayText, "colour", setColour, getColour, xmlElement, mode).defaultValues(ColourValue(1.0, 1.0, 1.0, 1.0)); 70 70 XMLPortParam(OverlayText, "caption", setCaption, getCaption, xmlElement, mode).defaultValues(""); 71 71 XMLPortParam(OverlayText, "textSize", setTextSize, getTextSize, xmlElement, mode).defaultValues(1.0f); 72 XMLPortParamTemplate(OverlayText, "align", setAlignment, getAlignment, xmlElement, mode, const std::string&).defaultValues("left"); 72 73 } 73 74 … … 84 85 else 85 86 return blankString; 87 } 88 89 void OverlayText::setColour(const ColourValue& colour) 90 { 91 if (this->text_) 92 this->text_->setColour(colour); 93 } 94 95 const ColourValue& OverlayText::getColour() const 96 { 97 if (this->text_) 98 return this->text_->getColour(); 99 else 100 return ColourValue::White; 101 } 102 103 void OverlayText::setAlignment(Ogre::TextAreaOverlayElement::Alignment alignment) 104 { 105 if (this->text_) 106 this->text_->setAlignment(alignment); 107 } 108 109 void OverlayText::setAlignment(const std::string& alignment) 110 { 111 if (alignment == "right") 112 this->setAlignment(Ogre::TextAreaOverlayElement::Right); 113 else if (alignment == "center") 114 this->setAlignment(Ogre::TextAreaOverlayElement::Center); 115 else // "left" and default 116 this->setAlignment(Ogre::TextAreaOverlayElement::Left); 117 } 118 119 std::string OverlayText::getAlignment() const 120 { 121 if (this->text_) 122 { 123 Ogre::TextAreaOverlayElement::Alignment alignment = this->text_->getAlignment(); 124 125 switch (alignment) 126 { 127 case Ogre::TextAreaOverlayElement::Right: 128 return "right"; 129 case Ogre::TextAreaOverlayElement::Center: 130 return "center"; 131 case Ogre::TextAreaOverlayElement::Left: 132 default:; 133 } 134 } 135 return "left"; 136 } 137 138 void OverlayText::setCaption(const std::string& caption) 139 { 140 this->caption_ = caption; 141 this->text_->setCaption(caption); 86 142 } 87 143 -
code/branches/objecthierarchy/src/orxonox/overlays/OverlayText.h
r1625 r1993 34 34 #include <string> 35 35 #include <OgrePrerequisites.h> 36 #include <OgreTextAreaOverlayElement.h> 36 37 #include "OrxonoxOverlay.h" 37 38 … … 49 50 virtual void sizeChanged(); 50 51 51 void setCaption(const std::string& caption) { this->caption_ = caption; }52 void setCaption(const std::string& caption); 52 53 const std::string& getCaption() const { return this->caption_; } 53 54 54 55 void setFont(const std::string& font); 55 56 const std::string& getFont() const; 57 58 void setColour(const ColourValue& colour); 59 const ColourValue& getColour() const; 60 61 void setAlignment(Ogre::TextAreaOverlayElement::Alignment alignment); 62 void setAlignment(const std::string& alignment); 63 std::string getAlignment() const; 56 64 57 65 void setTextSize(float size) { this->setSize(Vector2(size, size)); } -
code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDNavigation.cc
r1916 r1993 41 41 #include "core/XMLPort.h" 42 42 #include "objects/Radar.h" 43 #include "objects/CameraHandler.h"44 43 45 44 namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.