[SOLVED] Progress Bars

DudeCooper

26-01-2009 15:59:34

Hi i am trying to make a progress bar which updates its progress based on the current state of the game. so...

///loading

load something
update progress bar
load somethin else
update progress bar

i have loooked for documentation into it but the link is now dead.

MyGUI::ProgressPtr prog = mGUI->createWidget<MyGUI::Progress>("Progress",0,200,400,100,MyGUI::ALIGN_CENTER,"Main");
prog->setEnabled(true);
prog->setProgressRange(100);
prog->setProgressStartPoint(1);
prog->setProgressAutoTrack(true);


with this the bar flies around constantly which is not what i want, plus its way too fast. is there a way to update the progress every so often?

thank you

Altren

26-01-2009 17:00:20

i have loooked for documentation into it but the link is now dead. Er, what documentation? http://my-gui.sourceforge.net always up.
MyGUI::ProgressPtr prog = mGUI->createWidget<MyGUI::Progress>("Progress",0,200,400,100,MyGUI::ALIGN_CENTER,"Main");
prog->setEnabled(true); // OK
prog->setProgressRange(100); // OK
prog->setProgressStartPoint(1); // something horrible here, you need align in this method. Just delete this line
prog->setProgressAutoTrack(true); // when you call this you progress track starts moving automatically every frame
Look at header if you can't open documentation.
Actually you need something like MyGUI::ProgressPtr prog = mGUI->createWidget<MyGUI::Progress>("Progress",0,200,400,100,MyGUI::ALIGN_CENTER,"Main");
prog->setEnabled(true);
prog->setProgressRange(100);

/**
...
load something
*/
prog->setProgressPosition(10);
Ogre::Root::getSingleton().renderOneFrame(); // you need it to update your screen if you want to see changes immediately
/**
...
load more
*/
prog->setProgressPosition(20);
Ogre::Root::getSingleton().renderOneFrame();
// ... when you loaded everything
prog->setProgressPosition(100);

DudeCooper

26-01-2009 17:04:40

Thank you. i wil try the code in a short while. having a tad problem with the order of code at moment. the documentation i was looking at was this

viewtopic.php?f=17&t=7854 then it has links below to relevent parts

Thank you

Altren

26-01-2009 17:23:38

the documentation i was looking at was this

viewtopic.php?f=17&t=7854 then it has links below to relevent parts
Next time look at viewtopic.php?f=17&t=7488 , there's link to documentation.