Changeset 2024 for code/branches/objecthierarchy/src/orxonox/overlays
- Timestamp:
- Oct 28, 2008, 3:05:17 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
r2019 r2024 53 53 { 54 54 RegisterObject(OverlayGroup); 55 } 56 57 OverlayGroup::~OverlayGroup() 58 { 59 for (std::map<std::string, OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 60 delete it->second; 55 61 } 56 62 -
code/branches/objecthierarchy/src/orxonox/overlays/OverlayGroup.h
r2019 r2024 56 56 OverlayGroup(BaseObject* creator); 57 57 //! Empty destructor. 58 ~OverlayGroup() { }58 ~OverlayGroup(); 59 59 60 60 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); … … 63 63 static void scaleGroup(const std::string& name, float scale); 64 64 static void scrollGroup(const std::string& name, const Vector2& scroll); 65 66 inline const std::map<std::string, OrxonoxOverlay*>& getOverlays() const 67 { return this->hudElements_; } 65 68 66 69 void changedVisibility(); -
code/branches/objecthierarchy/src/orxonox/overlays/OverlayText.cc
r2019 r2024 65 65 } 66 66 67 XMLPortParam(OverlayText, "font", setFont, getFont,xmlElement, mode).defaultValues("Monofur");68 XMLPortParam(OverlayText, "colour", setColour, getColour,xmlElement, mode).defaultValues(ColourValue(1.0, 1.0, 1.0, 1.0));69 XMLPortParam(OverlayText, "caption", setCaption, getCaption,xmlElement, mode).defaultValues("");70 XMLPortParam(OverlayText, "textSize", setTextSize, getTextSize,xmlElement, mode).defaultValues(1.0f);71 XMLPortParam Template(OverlayText, "align", setAlignment, getAlignment, xmlElement, mode, const std::string&).defaultValues("left");67 XMLPortParam(OverlayText, "font", setFont, getFont, xmlElement, mode).defaultValues("Monofur"); 68 XMLPortParam(OverlayText, "colour", setColour, getColour, xmlElement, mode).defaultValues(ColourValue(1.0, 1.0, 1.0, 1.0)); 69 XMLPortParam(OverlayText, "caption", setCaption, getCaption, xmlElement, mode).defaultValues(""); 70 XMLPortParam(OverlayText, "textSize", setTextSize, getTextSize, xmlElement, mode).defaultValues(1.0f); 71 XMLPortParam(OverlayText, "align", setAlignmentString, getAlignmentString, xmlElement, mode).defaultValues("left"); 72 72 } 73 73 … … 106 106 } 107 107 108 void OverlayText::setAlignment(const std::string& alignment) 108 Ogre::TextAreaOverlayElement::Alignment OverlayText::getAlignment() const 109 { 110 if (this->text_) 111 return this->text_->getAlignment(); 112 else 113 return Ogre::TextAreaOverlayElement::Left; 114 } 115 116 void OverlayText::setAlignmentString(const std::string& alignment) 109 117 { 110 118 if (alignment == "right") … … 116 124 } 117 125 118 std::string OverlayText::getAlignment () const126 std::string OverlayText::getAlignmentString() const 119 127 { 120 128 if (this->text_) -
code/branches/objecthierarchy/src/orxonox/overlays/OverlayText.h
r2019 r2024 47 47 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); 48 48 49 protected:50 virtual void sizeChanged();51 52 49 void setCaption(const std::string& caption); 53 50 const std::string& getCaption() const { return this->caption_; } … … 60 57 61 58 void setAlignment(Ogre::TextAreaOverlayElement::Alignment alignment); 62 void setAlignment(const std::string& alignment); 63 std::string getAlignment() const; 59 Ogre::TextAreaOverlayElement::Alignment getAlignment() const; 60 61 protected: 62 virtual void sizeChanged(); 63 64 void setAlignmentString(const std::string& alignment); 65 std::string getAlignmentString() const; 64 66 65 67 void setTextSize(float size) { this->setSize(Vector2(size, size)); }
Note: See TracChangeset
for help on using the changeset viewer.