示例#1
0
 /** Init the message text, do linebreak as required. */
 void init()
 {
     const GUIEngine::BoxRenderParams &brp =
         GUIEngine::getSkin()->getBoxRenderParams(m_render_type);
     const unsigned width = irr_driver->getActualScreenSize().Width;
     const unsigned height = irr_driver->getActualScreenSize().Height;
     const unsigned max_width = width - (brp.m_left_border +
         brp.m_right_border);
     m_text =
         GUIEngine::getGUIEnv()->addStaticText(m_message.c_str(),
         core::recti(0, 0, max_width, height));
     m_text->setRightToLeft(translations->isRTLText(m_message));
     core::dimension2du dim(m_text->getTextWidth(),
         m_text->getTextHeight());
     dim.Width += brp.m_left_border + brp.m_right_border;
     int x = (width - dim.Width) / 2;
     int y = height - int(1.5f * dim.Height);
     g_area = irr::core::recti(x, y, x + dim.Width, y + dim.Height);
     m_text->setRelativePosition(g_area);
     m_text->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER);
     m_text->grab();
     m_text->remove();
 }
示例#2
0
 virtual ~CProgress() {
   m_pImg->remove();
   m_pText->remove();
   m_pBar->remove();
   ode::CIrrOdeManager::getSharedInstance()->getIrrThread()->getInputQueue()->removeEventListener(this);
 }