MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / addTextBox

Method addTextBox

source/render/TextRenderer.cpp:47–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void 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
65void TextRenderer::removeTextBox(const std::string& ID)
66{

Callers 1

startClientMethod · 0.80

Calls 3

atowFunction · 0.85
setCaptionMethod · 0.80
setPositionMethod · 0.45

Tested by

no test coverage detected