Code: Select all
/ setup GUI system
mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow,
Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
mGUISystem = new CEGUI::System(mGUIRenderer);
CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
// load scheme and set up defaults
CEGUI::SchemeManager::getSingleton().loadScheme(
(CEGUI::utf8*)"TaharezLookSkin.scheme");
mGUISystem->setDefaultMouseCursor(
(CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
mGUISystem->setDefaultFont((CEGUI::utf8*)"BlueHighway-12");
CEGUI::MouseCursor::getSingleton().setImage("TaharezLook", "MouseArrow");
CEGUI::MouseCursor::getSingleton().show( );
win = CEGUI::WindowManager::getSingletonPtr();
sheet = win->createWindow("DefaultGUISheet", "CEGUIDemo/Sheet");
score = win->createWindow("TaharezLook/StaticText", "CEGUIDemo/ScoreText");
score->setText("Score: ");
score->setSize(CEGUI::UVector2(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.05, 0)));
score->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0), CEGUI::UDim(0.85, 0)));
sheet->addChildWindow(score);
lives = win->createWindow("TaharezLook/StaticText", "CEGUIDemo/LivesText");
lives->setText("Lives: ");
lives->setSize(CEGUI::UVector2(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.05, 0)));
lives->setPosition(CEGUI::UVector2(CEGUI::UDim(0.85, 0), CEGUI::UDim(0.85, 0)));
sheet->addChildWindow(lives);
mGUISystem->setGUISheet(sheet);
I do that in a setup function and then in frameStarted I want to change the text but it comes up with a memory access violation when I:
Code: Select all
lives->setText("Lives: " StringConverter::toString(numLives));
How can I change the text every frame?