Im trying to display the experience of my bubble hero but im having some trouble when i attempt to render it inside
the experience bar's rectangle and i desperately need some help
This is my non working code that doesn't fill the whole rectangle :
Code: Select all
int Init3dBubbleStats(Bubble3D& bubble)
{
bubble.ExperienceForThisLvl = 1000; //Test for 100% fill
bubble.ExperienceNeededForThisLvl = 1000;
return 1;
}
int GetExperience(int Points,int MaxPoints,int Ratio)
{
return Points * Ratio / MaxPoints;
}
int DisplayExperience()
{
//Display based on %
int Show = GetExperience(Bubble.ExperienceForThisLvl,Bubble.ExperienceNeededForThisLvl,ExpBar.Width);
//background
ShowRect(RED_RECT,ExpBar.x,ExpBar.y,ExpBar.Width,ExpBar.Height);
//foreground
ShowRect(GREEN_RECT,ExpBar.x,ExpBar.y,Show,ExpBar.Height);
return 1;
}