MikeyUchiha
Member
|
Loading a Progress Bar and setting progress
There isn't a tutorial on this at all so I'm a little stuck. Basically, I want to create a Health Bar that increases to the max and decreases. Inside the progress bar. I was able to get the bar drawn in game. But, for some reason, it won't update the color. This is what I've got so far. A push in the right direction would be greatly appreciated.
MainSkillBar.h
Code:
struct MainSkillBar
{
GuiObjs gobjs;
Progress *health;
void create();
void update();
}
extern MSB;
MainSkillBar.cpp
Code:
/******************************************************************************/
#include "stdafx.h"
#include "Main.h"
/******************************************************************************/
MainSkillBar MSB;
/******************************************************************************/
// MANAGE
/******************************************************************************/
void MainSkillBar::create()
{
gobjs.load("gui/obj/health.gobj"); Gui+=gobjs;
health=&gobjs.getProgress("Health");
}
/******************************************************************************/
// UPDATE
/******************************************************************************/
void MainSkillBar::update()
{
UInt x = ATR.GetAttributeValue(HEALTH);
Progress health;
Gui.update();
health.set(x * .10);
}
Thanks for your time and help.
|
|
07-23-2011 09:15 PM |
|
Dandruff
Member
|
RE: Loading a Progress Bar and setting progress
try just putting 0.5 in there and see if it works. If it doesn't, try removing the second definition of health in ::update() and do health->set(0.5f);
|
|
07-24-2011 12:45 AM |
|
MikeyUchiha
Member
|
RE: Loading a Progress Bar and setting progress
yes, that worked perfectly Dandruff. I actually figured that out RIGHT before you posted. But thanks so much for the help. And I did remove the second definition of Progress health;
In case anyone else has these same issues. ^_^
|
|
07-24-2011 01:21 AM |
|