| 45 | } |
| 46 | |
| 47 | void TextRenderer::addTextBox(const std::string& ID, const std::string& text, |
| 48 | Ogre::Real x, Ogre::Real y, Ogre::Real width, Ogre::Real height, |
| 49 | const Ogre::ColourValue& color) |
| 50 | { |
| 51 | Ogre::OverlayElement* textBox = mOverlayMgr->createOverlayElement("TextArea", ID); |
| 52 | textBox->setDimensions(width, height); |
| 53 | textBox->setMetricsMode(Ogre::GMM_PIXELS); |
| 54 | textBox->setPosition(x, y); |
| 55 | textBox->setParameter("font_name", "MedievalSharp"); |
| 56 | textBox->setParameter("char_height", "16"); |
| 57 | textBox->setColour(color); |
| 58 | |
| 59 | // Note: We make ogre handle an UTF8 string |
| 60 | textBox->setCaption(static_cast<Ogre::UTFString>(Helper::atow(text))); |
| 61 | |
| 62 | mPanel->addChild(textBox); |
| 63 | } |
| 64 | |
| 65 | void TextRenderer::removeTextBox(const std::string& ID) |
| 66 | { |
no test coverage detected