| 178 | } |
| 179 | |
| 180 | uint32_t MovableTextOverlay::createChildOverlay(const Ogre::String& fontName, Ogre::Real charHeight, |
| 181 | const Ogre::ColourValue& color, const Ogre::String& materialName) |
| 182 | { |
| 183 | uint32_t id = mChildOverlays.size(); |
| 184 | Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton(); |
| 185 | ChildOverlay childOverlay(fontName, charHeight, color, materialName); |
| 186 | childOverlay.mOverlayContainer = static_cast<Ogre::OverlayContainer*>(overlayManager.createOverlayElement( |
| 187 | "Panel", mName + Helper::toString(id) + "_OvC")); |
| 188 | childOverlay.mOverlayContainer->setDimensions(0.0, 0.0); |
| 189 | |
| 190 | mOverlay->add2D(childOverlay.mOverlayContainer); |
| 191 | |
| 192 | childOverlay.mOverlayText = overlayManager.createOverlayElement("TextArea", mName + Helper::toString(id) + "_OvTxt"); |
| 193 | childOverlay.mOverlayContainer->addChild(childOverlay.mOverlayText); |
| 194 | |
| 195 | childOverlay.mOverlayText->setMetricsMode(Ogre::GMM_RELATIVE); |
| 196 | childOverlay.mOverlayText->setDimensions(1.0, 1.0); |
| 197 | childOverlay.mOverlayText->setMetricsMode(Ogre::GMM_PIXELS); |
| 198 | childOverlay.mOverlayText->setPosition(0, 0); |
| 199 | |
| 200 | childOverlay.setMaterialName(materialName); |
| 201 | |
| 202 | childOverlay.mOverlayText->setColour(color); |
| 203 | |
| 204 | childOverlay.mOverlayText->setParameter("font_name", fontName); |
| 205 | childOverlay.mOverlayText->setParameter("char_height", Helper::toString(charHeight)); |
| 206 | childOverlay.mOverlayText->setParameter("horz_align", "center"); |
| 207 | childOverlay.mOverlayText->setParameter("vert_align", "top"); |
| 208 | |
| 209 | mChildOverlays.push_back(childOverlay); |
| 210 | |
| 211 | return id; |
| 212 | } |
| 213 | |
| 214 | void MovableTextOverlay::setVisible(bool visible) |
| 215 | { |
no test coverage detected