About Store Forum Documentation Contact



Post Reply 
Vertical Progressbar
Author Message
Qbound Offline
Member

Post: #1
Vertical Progressbar
Hi,

in my game i use some diablo style bowls for mana and live. Therefore i need some progressbars which base 0 is the bottom and 100% or 1.0 is TOP.
I think it would be easy to implement those progressbars into the engine. (hopefully)

Bye
Oliver
06-22-2010 06:27 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #2
RE: Vertical Progressbar
Something like this, you just need to change the way it goes, mine goes from left to right,

void DrawBar(Color color,Rect &rect,Flt frac,Flt frac2)
{
Flt min,max; MinMax(frac,frac2,min,max);
Rect inside=rect; inside.extend(-0.008f);
Images("gfx/bar/backbar.gfx" )->draw (rect);
Images("gfx/bar/progress.gfx")->drawPart(ColorAlpha(color,0.4f),color, inside.min.x,inside.max.y, inside.w()*max,inside.h(), 0,0,max,1);
Images("gfx/bar/progress.gfx")->drawPart( color ,color, inside.min.x,inside.max.y, inside.w()*min,inside.h(), 0,0,min,1);
Images("gfx/bar/border.gfx" )->draw (rect);
}
void DrawBars()
{
if(Players.elms())
{
Player &plr=Players[0];
// health
Flt health_frac=plr.health/plr.current_health_max;
static Flt health_frac_smooth; AdjustValTarget(health_frac_smooth,health_frac,Time.d()*0.4f);
DrawBar(RED,Rect_LD(-D.w()+0.05f,-D.h()+0.12f,0.4f,0.05f),health_frac,health_frac_smooth);
}
}
(This post was last modified: 06-22-2010 07:04 PM by Zervox.)
06-22-2010 06:56 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #3
RE: Vertical Progressbar
yeah i need this too.
06-23-2010 10:05 AM
Find all posts by this user Quote this message in a reply
Post Reply