kingdranix
08-11-2007 09:01:03
I modified the ExampleLoadingBar.h to use QuickGUI.
I'm not really sure how to create a loading screen using QuickGUI. It seems that the font is become small or another font type is used when I did a load screen using QuickGUI.
If I use the default overlay to render the loading screen, the font looks normal.
Here is the code when I'm using QuickGUI to render the loading screen.
Here's the modified code in the ExampleLoadingBar.h
Is there anything that I missed or shouldn't be doing? The problem here is the fonts changed other than that, everything works normally.
I'm not really sure how to create a loading screen using QuickGUI. It seems that the font is become small or another font type is used when I did a load screen using QuickGUI.
If I use the default overlay to render the loading screen, the font looks normal.
Here is the code when I'm using QuickGUI to render the loading screen.
void CGameManager::InitResources()
{
QuickGUI::registerScriptParser();
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("quickgui");
m_GUIManager = new QuickGUI::GUIManager(m_Camera->getViewport());
QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui","quickgui");
m_GUIManager->setSceneManager(m_SceneManager);
m_Sheet = m_GUIManager->getDefaultSheet();
m_GUIManager->setActiveSheet(m_Sheet);
m_LoadBar = new CLoadingBar(m_GUIManager);
m_LoadBar->start(CGameApp::GetSingleton()->GetRenderWindow(), 1, 1, 0.5);
}
void CGameManager::InitGame()
{
SAFE_CREATE(m_StateManager, CStateManager);
m_StateManager->AddState(new CMenuTest(m_GUIManager, m_StateManager));
m_StateManager->AddState(new CGameOne(m_StateManager));
m_StateManager->SetState("MenuTest");
m_LoadBar->finish();
SAFE_DELETE(m_LoadBar);
}
Here's the modified code in the ExampleLoadingBar.h
void CLoadingBar::start(Ogre::RenderWindow* window, unsigned short numGroupsInit,
unsigned short numGroupsLoad, Ogre::Real initProportion)
{
mWindow = window;
mNumGroupsInit = numGroupsInit;
mNumGroupsLoad = numGroupsLoad;
mInitProportion = initProportion;
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("Bootstrap");
if(m_GUIManager)
{
QuickGUI::Sheet *mSheet = m_GUIManager->getActiveSheet();
m_LoadBar = mSheet->createProgressBar();
m_LoadBar->setDimensions(QuickGUI::Rect(mWindow->getWidth()*0.5,mWindow->getHeight()*0.5,160,18));
m_LoadBar->setInitialPixelOffset(0);
m_LoadBarDescription = mSheet->createLabel();
m_LoadBarDescription->setPosition(440,315);
m_LoadBarDescription->setTexture("");
m_LoadBarDescription->setText("");
m_LoadBarDescription->appearOverWidget(m_LoadBar);
m_LoadBarComment = mSheet->createLabel();
m_LoadBarComment->setPosition(440,415);
m_LoadBarComment->setTexture("");
m_LoadBarComment->setText("");
m_LoadBarComment->appearOverWidget(m_LoadBar);
mProgressBarMaxSize = 160;
}
else
{
Ogre::OverlayManager& omgr = Ogre::OverlayManager::getSingleton();
mLoadOverlay = (Ogre::Overlay*)omgr.getByName("Core/LoadOverlay");
mLoadOverlay->show();
mLoadingBarElement = omgr.getOverlayElement("Core/LoadPanel/Bar/Progress");
mLoadingCommentElement = omgr.getOverlayElement("Core/LoadPanel/Comment");
mLoadingDescriptionElement = omgr.getOverlayElement("Core/LoadPanel/Description");
Ogre::OverlayElement* barContainer = omgr.getOverlayElement("Core/LoadPanel/Bar");
mProgressBarMaxSize = barContainer->getWidth();
mLoadingBarElement->setWidth(0);
}
Ogre::ResourceGroupManager::getSingleton().addResourceGroupListener(this);
}
Is there anything that I missed or shouldn't be doing? The problem here is the fonts changed other than that, everything works normally.