Пример #1
0
    //-----------------------------------------------------------------------
    OverlayElement* Profiler::createTextArea(const String& name, Real width, Real height, Real top, Real left, 
                                         uint fontSize, const String& caption, bool show) {


        OverlayElement* textArea = 
			OverlayManager::getSingleton().createOverlayElement("TextArea", name);
        textArea->setMetricsMode(GMM_PIXELS);
        textArea->setWidth(width);
        textArea->setHeight(height);
        textArea->setTop(top);
        textArea->setLeft(left);
        textArea->setParameter("font_name", "BlueHighway");
        textArea->setParameter("char_height", StringConverter::toString(fontSize));
        textArea->setCaption(caption);
        textArea->setParameter("colour_top", "1 1 1");
        textArea->setParameter("colour_bottom", "1 1 1");

        if (show) {
            textArea->show();
        }
        else {
            textArea->hide();
        }

        return textArea;

    }
Пример #2
0
  void _setOverlay(void)
  {
    mOverlayMgr = OverlayManager::getSingletonPtr();
    mTextOverlay = mOverlayMgr->create("TextOverlay");

    mPanel = static_cast<Ogre::OverlayContainer*>(mOverlayMgr->createOverlayElement("Panel", "container1"));
    mPanel->setDimensions(1, 1);
    mPanel->setPosition(-0.3f, 0.5f);

    OverlayElement* textBox = mOverlayMgr->createOverlayElement("TextArea", "TextID");
    textBox->setMetricsMode(Ogre::GMM_PIXELS);
    textBox->setPosition(10, 10);
    textBox->setWidth(100);
    textBox->setHeight(20);
    textBox->setParameter("font_name", "Font/NanumBold18");
    textBox->setParameter("char_height", "40");
    textBox->setColour(Ogre::ColourValue::White);
    textBox->setCaption(L"한국산업기술대학교 이대현 선수");
    mPanel->addChild(textBox);

    mTextOverlay->add2D(mPanel);
    mTextOverlay->show();

    mLogoOverlay = OverlayManager::getSingleton().getByName("Overlay/KPU_LOGO");
    mLogoOverlay->show();

mLogoOverlay = OverlayManager::getSingleton().getByName("Overlay/Information");
mLogoOverlay->show(); 
  }