Changeset 1633 for code/trunk
- Timestamp:
- Jun 29, 2008, 6:45:53 PM (16 years ago)
- Location:
- code/trunk/src/orxonox/overlays
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r1632 r1633 122 122 123 123 XMLPortParam(OrxonoxOverlay, "size", setSize, getSize, xmlElement, mode) 124 .defaultValues(Vector2( 0.5f, 0.5f));124 .defaultValues(Vector2(1.0f, 1.0f)); 125 125 XMLPortParam(OrxonoxOverlay, "pickPoint", setPickPoint, getPickPoint, xmlElement, mode) 126 126 .defaultValues(Vector2(0.0f, 0.0f)); -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r1632 r1633 132 132 133 133 //! Gets the current size that was set (uncorrected) 134 Vector2 getSize() const { return this->size_ * this->sizeCorrection_; }134 const Vector2& getSize() const { return this->size_; } 135 135 136 136 //! Gets the actual size of the overlay on the screen (corrected) 137 const Vector2& getActualSize() const { return this->size_; }137 Vector2 getActualSize() const { return this->size_ * this->sizeCorrection_; } 138 138 139 139 //! Gets the current size correction (default: 1.0, 1.0) -
code/trunk/src/orxonox/overlays/OverlayGroup.cc
r1628 r1633 116 116 } 117 117 118 //! Changes the visibility of all elements 119 void OverlayGroup::changedVisibility() 120 { 121 for (std::map<std::string, OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 122 (*it).second->setVisible(this->isVisible()); 123 } 124 118 125 119 126 //########### Console commands ############ -
code/trunk/src/orxonox/overlays/OverlayGroup.h
r1625 r1633 80 80 OrxonoxOverlay* getElement(unsigned int index); 81 81 82 void changedVisibility(); 83 82 84 std::map<std::string, OrxonoxOverlay*> hudElements_; //!< Contains all the OrxonoxOverlays of the this group. 83 85 Vector2 scale_; //!< Current scale (independant of the elements). -
code/trunk/src/orxonox/overlays/console/InGameConsole.cc
r1625 r1633 36 36 #include <OgreOverlayManager.h> 37 37 #include <OgreOverlayContainer.h> 38 #include <OgreStringConverter.h> 39 38 #include <OgreFontManager.h> 39 #include <OgreFont.h> 40 41 #include "util/Math.h" 42 #include "util/Convert.h" 40 43 #include "core/Debug.h" 41 44 #include "core/CoreIncludes.h" … … 43 46 #include "core/ConsoleCommand.h" 44 47 #include "core/input/InputManager.h" 45 #include "util/Math.h"46 48 #include "GraphicsEngine.h" 47 49 … … 136 138 this->consoleOverlayContainer_->addChild(this->consoleOverlayBorder_); 137 139 140 // create a new font to match the requested size exactly 141 Ogre::FontPtr font = static_cast<Ogre::FontPtr> 142 (Ogre::FontManager::getSingleton().create("MonofurConsole", "General")); 143 font->setType(Ogre::FT_TRUETYPE); 144 font->setSource("Monofur.ttf"); 145 font->setTrueTypeSize(18); 146 // reto: I don't know why, but setting the resolution twice as high makes the font look a lot clearer 147 font->setTrueTypeResolution(192); 148 font->addCodePointRange(Ogre::Font::CodePointRange(33, 126)); 149 font->addCodePointRange(Ogre::Font::CodePointRange(161, 255)); 150 138 151 // create the text lines 139 152 this->consoleOverlayTextAreas_ = new Ogre::TextAreaOverlayElement*[LINES]; 140 153 for (int i = 0; i < LINES; i++) 141 154 { 142 this->consoleOverlayTextAreas_[i] = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleTextArea" + Ogre::StringConverter::toString(i)));155 this->consoleOverlayTextAreas_[i] = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleTextArea" + convertToString(i))); 143 156 this->consoleOverlayTextAreas_[i]->setMetricsMode(Ogre::GMM_PIXELS); 144 this->consoleOverlayTextAreas_[i]->setFontName("Monofur ");157 this->consoleOverlayTextAreas_[i]->setFontName("MonofurConsole"); 145 158 this->consoleOverlayTextAreas_[i]->setCharHeight(18); 146 159 this->consoleOverlayTextAreas_[i]->setParameter("colour_top", "0.21 0.69 0.21"); … … 153 166 this->consoleOverlayCursor_ = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleCursor")); 154 167 this->consoleOverlayCursor_->setMetricsMode(Ogre::GMM_PIXELS); 155 this->consoleOverlayCursor_->setFontName("Monofur ");168 this->consoleOverlayCursor_->setFontName("MonofurConsole"); 156 169 this->consoleOverlayCursor_->setCharHeight(18); 157 170 this->consoleOverlayCursor_->setParameter("colour_top", "0.21 0.69 0.21");
Note: See TracChangeset
for help on using the changeset viewer.