QuickGUI not showing up

dreadwulgaru

24-10-2007 20:13:39

In my friend's and my program, we initialise quickgui the way it is shown in the QuickGUIdemo (except in the same class as everything else we have), but for some reason nothing is showing up when things are rendered. We can still move our character around the world and kill the robot we have set up, but the quickgui does not show up at all. (We are trying to use it for a HUD at the moment). Any help would be great, thanks :)

Here is the declarations

QuickGUI::GUIManager* mGuiManager;

// QuickGUI overlay
QuickGUI::Sheet* overlaySheet;
QuickGUI::ProgressBar* lifeBar;
QuickGUI::ProgressBar* manaBar;
QuickGUI::TextBox* guiConsole;
QuickGUI::Label* lifeLabel;
QuickGUI::Label* lifeValue;


Here is the initialisation code (called at end of createScene())

mGuiManager = QuickGUI::GUIManager::getSingletonPtr();
mGuiManager->setup(mWindow->getWidth(),mWindow->getHeight());


This is where the stuff is actually created (called at end of createScene, after initialisation code)

bool Brawl::createHUD()
{
using QuickGUI::Rect;
using QuickGUI::Point;
using QuickGUI::Size;

// create overlay
//overlaySheet = mGuiManager->createSheet("GameOverlay");
overlaySheet = mGuiManager->getDefaultSheet();
overlaySheet->setDefaultFont("acmesa.14");

// create Player's health bar
lifeBar = overlaySheet->createProgressBar("HUDHealth",Rect(0.4,0.55,.2,.03));
lifeBar->setInitialPixelOffset(0);

// create health bar's label
lifeLabel = overlaySheet->createLabel("HUDHealthLabel",Rect(0.4,0.5125,.07,.07),"");
lifeLabel->getText()->setCaption("HP");
lifeLabel->appearOverWidget(lifeBar);

// create text to tell exact amount of health
lifeValue = overlaySheet->createLabel(Rect(.55,0.5125,.07,.07),"");
lifeValue->getText()->setCaption("100/100");
lifeValue->appearOverWidget(lifeBar);

// create console window
guiConsole = overlaySheet->createTextBox("UserConsole",Rect(.225,.6,.2,.05));
guiConsole->setText("Welcome to Medieval Brawl v0.1a.");

//overlaySheet->show();

return true;
}

the health bar is updated when every frameStarted method as follows:

lifeBar->setProgress((tempPlayer->playerHealth)/100);
lifeValue->getText()->setCaption(StringConverter::toString(tempPlayer->playerHealth) + "/100");


Yet not only does the health bar not update, but it doesn't show up at all. None of the other things do as well...We are probly missing something really obvious, but we have not been able to spot it. If you can, then thank you very much. :oops:

kungfoomasta

24-10-2007 20:22:41

It could be that the required images (resources) are not on any defined Ogre resource path? Check your resource.cfg file, and make sure there are locations to files like "qgui.button.png", etc.

Other than that, I dont' see anything obvious. If you can update to the SVN version I can give you direct help, since I am more familiar with that code. There are some major changes in SVN that will be present in the next version, and using it from the beginning will require little adjustment when the next version is released. If you aren't familiar with SVN, I can provide a pre-release drop. I just need to zip it up and throw it online.