VSLib
Simple, powerful VScript Library for L4D2
 All Classes Namespaces Files Functions Pages
VSLib.HUD.Bar Class Reference

Progress bar HUD item. This is a HUD item that acts as a configurable progress bar. One can easily use this HUD item to display numerical values and percentages. Example uses would be stamina/magic bars, health bars, fuel bars, and whatever else you can think of. More...

Inheritance diagram for VSLib.HUD.Bar:
VSLib.HUD.Item

Private Member Functions

 Bar (string formatStr="{value}% [{bar}]", int initialValue=0, int maxValue=100, int width=50, string fill="|", string empty=".")
 
void SetBarValue (int value)
 
int GetBarValue ()
 
int GetBarMaxValue ()
 
string GetString ()
 
int SetBarWidth (int width)
 
int GetBarWidth ()
 
void SetBarCharacters (string fill="|", string empty=".")
 
void SetBarMaxValue (int value)
 

Detailed Description

Progress bar HUD item. This is a HUD item that acts as a configurable progress bar. One can easily use this HUD item to display numerical values and percentages. Example uses would be stamina/magic bars, health bars, fuel bars, and whatever else you can think of.

Constructor & Destructor Documentation

VSLib.HUD.Bar.Bar ( string  formatStr = "{value}% [{bar}]",
int  initialValue = 0,
int  maxValue = 100,
int  width = 50,
string  fill = "|",
string  empty = "." 
)
private

Creates the HUD item with a format string.

Parameters
formatStrThe format string; default will display as "21% [|||||||.....]" for example
initialValueThe starting value of this progress bar
maxValueThe maximum possible value of this progress bar
fillThe solid block character
emptyThe open block character

Member Function Documentation

int VSLib.HUD.Bar.GetBarMaxValue ( )
private

Gets the progress bar's max value

int VSLib.HUD.Bar.GetBarValue ( )
private

Gets the progress bar's value

int VSLib.HUD.Bar.GetBarWidth ( )
private

Returns the bar's width

string VSLib.HUD.Bar.GetString ( )
private

Returns the full formatted progress bar with text

void VSLib.HUD.Bar.SetBarCharacters ( string  fill = "|",
string  empty = "." 
)
private

Changes the character blocks of the progress bar

void VSLib.HUD.Bar.SetBarMaxValue ( int  value)
private

Changes the max value of the progress bar

void VSLib.HUD.Bar.SetBarValue ( int  value)
private

Sets the progress bar's value

int VSLib.HUD.Bar.SetBarWidth ( int  width)
private

Changes the width (number of characters) of the progress bar


The documentation for this class was generated from the following file: