Changeset 2222 for code/branches/overlay
- Timestamp:
- Nov 19, 2008, 3:29:24 PM (16 years ago)
- Location:
- code/branches/overlay/src/orxonox/overlays/stats
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/overlay/src/orxonox/overlays/stats/CreateLines.cc
r2200 r2222 60 60 } 61 61 62 void createTextArea(unsigned int lineIndex) { 62 /** 63 @brief Ensures that the number of OverlayElements is equal to numberOfColumns. 64 */ 65 void setNumberOfColumns(unsigned int numberOfColumns) { 63 66 64 this->statsOverlayTextAreas_ = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex))); 65 this->overlay_->add2D(this->statsOverlayTextAreas_); 67 Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr(); 66 68 67 // this->textColumns_.push_back(); pointer to be added 69 while (textColumns_.getSize() < numberOfColumns) { 70 71 tempTextArea* = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex))); 72 textColumns_->add2D(tempTextArea); 73 textColumns_.push_back(tempTextArea); 74 75 } 76 77 while (textColumns_.getSize() > numberOfColumns) { 78 79 ovMan->destroy(textColumns_.back()); 80 textColumns_.pop_back(); 81 82 } 83 84 } 85 86 void alignColumn(int columnIndex, float leftOffset) { 87 88 this->textColumns_[columnIndex]->setPosition(leftOffset,0); 89 90 } 91 92 void setColumnText(int columnIndex, string columnText) { 93 94 this->textColumns_[columnIndex]->setCaption(columnText); 68 95 69 96 } -
code/branches/overlay/src/orxonox/overlays/stats/CreateLines.h
r2200 r2222 50 50 51 51 private: // functions 52 void createTextArea(); 52 void setNumberOfColumns(); 53 void alignColumn(); 54 void setColumnText(); 53 55 54 56 private: // variables
Note: See TracChangeset
for help on using the changeset viewer.