HealthBar Class Reference

#include <HealthBar.h>

List of all members.

Public Member Functions

 HealthBar (Ogre::ManualObject *mObj, float percent, bool startOnLeft)
 HealthBar (const HealthBar &orig)
virtual ~HealthBar ()
void Draw (Ogre::Vector3 pos)
void Hide ()
void ClearVertices ()
 HealthBar (Ogre::ManualObject *mObj, float percent, bool startOnLeft)
 HealthBar (const HealthBar &orig)
virtual ~HealthBar ()
void Draw (Ogre::Vector3 pos)
void Hide ()
void ClearVertices ()
 HealthBar (Ogre::ManualObject *mObj, float percent, bool startOnLeft)
 HealthBar (const HealthBar &orig)
virtual ~HealthBar ()
void Draw (Ogre::Vector3 pos)
void Hide ()
void ClearVertices ()
 HealthBar (Ogre::ManualObject *mObj, float percent, bool startOnLeft)
 HealthBar (const HealthBar &orig)
virtual ~HealthBar ()
void Draw (Ogre::Vector3 pos)
void Hide ()
void ClearVertices ()
 HealthBar (Ogre::ManualObject *mObj, float percent, bool startOnLeft)
 HealthBar (const HealthBar &orig)
virtual ~HealthBar ()
void Draw (Ogre::Vector3 pos)
void Hide ()
void ClearVertices ()

Public Attributes

RectfullBar
RectemptyBar
float percent
bool startOnLeft
RectfullBar
RectemptyBar
RectfullBar
RectemptyBar
RectfullBar
RectemptyBar
RectfullBar
RectemptyBar


Detailed Description

Health bar displays a bar above selected entities, showing how much damage the entity has taken. The health bar is composed of two rectangle, a green rectangle for the health remaining, and a red bar for the health depleted. These two rectangles are connected to form a single rectangle. An object of this class may contain multiple healthbars, one for each time the Draw() function is called.

Definition at line 17 of file HealthBar.h.


Constructor & Destructor Documentation

HealthBar::HealthBar ( Ogre::ManualObject *  mObj,
float  percent = 100.0f,
bool  startOnLeft = true 
)

Constructs an object for displaying a set of health bars

Parameters:
mObj A pointer to an object containing all the vertices of all health bars to draw.
percent the default percent at which the health bar shoul be "filled"
startOnLeft switch that determines if the health bar fills from the right or left

Definition at line 10 of file HealthBar.cpp.

HealthBar::HealthBar ( const HealthBar orig  ) 

Definition at line 16 of file HealthBar.cpp.

HealthBar::~HealthBar (  )  [virtual]

Definition at line 20 of file HealthBar.cpp.

HealthBar::HealthBar ( Ogre::ManualObject *  mObj,
float  percent,
bool  startOnLeft 
)

Constructs an object for displaying a set of health bars

Parameters:
mObj A pointer to an object containing all the vertices of all health bars to draw.
percent the default percent at which the health bar shoul be "filled"
startOnLeft switch that determines if the health bar fills from the right or left

HealthBar::HealthBar ( const HealthBar orig  ) 

virtual HealthBar::~HealthBar (  )  [virtual]

HealthBar::HealthBar ( Ogre::ManualObject *  mObj,
float  percent,
bool  startOnLeft 
)

Constructs an object for displaying a set of health bars

Parameters:
mObj A pointer to an object containing all the vertices of all health bars to draw.
percent the default percent at which the health bar shoul be "filled"
startOnLeft switch that determines if the health bar fills from the right or left

HealthBar::HealthBar ( const HealthBar orig  ) 

virtual HealthBar::~HealthBar (  )  [virtual]

HealthBar::HealthBar ( Ogre::ManualObject *  mObj,
float  percent,
bool  startOnLeft 
)

Constructs an object for displaying a set of health bars

Parameters:
mObj A pointer to an object containing all the vertices of all health bars to draw.
percent the default percent at which the health bar shoul be "filled"
startOnLeft switch that determines if the health bar fills from the right or left

HealthBar::HealthBar ( const HealthBar orig  ) 

virtual HealthBar::~HealthBar (  )  [virtual]

HealthBar::HealthBar ( Ogre::ManualObject *  mObj,
float  percent,
bool  startOnLeft 
)

Constructs an object for displaying a set of health bars

Parameters:
mObj A pointer to an object containing all the vertices of all health bars to draw.
percent the default percent at which the health bar shoul be "filled"
startOnLeft switch that determines if the health bar fills from the right or left

HealthBar::HealthBar ( const HealthBar orig  ) 

virtual HealthBar::~HealthBar (  )  [virtual]


Member Function Documentation

void HealthBar::Draw ( Ogre::Vector3  pos  ) 

Adds a new HealthBar to be drawn at the given position. The proportion of the red/green bars is determined by percent.

See also:
Hide

ClearVirtices

Parameters:
pos The position at which to draw the health bar.

Definition at line 24 of file HealthBar.cpp.

References Rect::Draw(), emptyBar, fullBar, Rect::length, and percent.

Referenced by OgreGFX::UIMgr::decorateSelectedEntities().

void HealthBar::Hide (  )  [inline]

Makes the health bar objects invisible, without actually destroying the vertices used to draw the rectangles.

See also:
Draw

ClearVirtices

Definition at line 49 of file HealthBar.h.

References emptyBar, fullBar, and Rect::Hide().

void HealthBar::ClearVertices (  ) 

Deletes all health bars drawn in an object.

See also:
Hide

Draw

Definition at line 40 of file HealthBar.cpp.

References Rect::ClearVertices(), emptyBar, and fullBar.

Referenced by OgreGFX::UIMgr::frameEnded().

void HealthBar::Draw ( Ogre::Vector3  pos  ) 

Adds a new HealthBar to be drawn at the given position. The proportion of the red/green bars is determined by percent.

See also:
Hide

ClearVirtices

Parameters:
pos The position at which to draw the health bar.

void HealthBar::Hide (  )  [inline]

Makes the health bar objects invisible, without actually destroying the vertices used to draw the rectangles.

See also:
Draw

ClearVirtices

Definition at line 49 of file HealthBar.h.

References emptyBar, fullBar, and Rect::Hide().

void HealthBar::ClearVertices (  ) 

Deletes all health bars drawn in an object.

See also:
Hide

Draw

void HealthBar::Draw ( Ogre::Vector3  pos  ) 

Adds a new HealthBar to be drawn at the given position. The proportion of the red/green bars is determined by percent.

See also:
Hide

ClearVirtices

Parameters:
pos The position at which to draw the health bar.

void HealthBar::Hide (  )  [inline]

Makes the health bar objects invisible, without actually destroying the vertices used to draw the rectangles.

See also:
Draw

ClearVirtices

Definition at line 49 of file HealthBar.h.

References emptyBar, fullBar, and Rect::Hide().

void HealthBar::ClearVertices (  ) 

Deletes all health bars drawn in an object.

See also:
Hide

Draw

void HealthBar::Draw ( Ogre::Vector3  pos  ) 

Adds a new HealthBar to be drawn at the given position. The proportion of the red/green bars is determined by percent.

See also:
Hide

ClearVirtices

Parameters:
pos The position at which to draw the health bar.

void HealthBar::Hide (  )  [inline]

Makes the health bar objects invisible, without actually destroying the vertices used to draw the rectangles.

See also:
Draw

ClearVirtices

Definition at line 49 of file HealthBar.h.

References emptyBar, fullBar, and Rect::Hide().

void HealthBar::ClearVertices (  ) 

Deletes all health bars drawn in an object.

See also:
Hide

Draw

void HealthBar::Draw ( Ogre::Vector3  pos  ) 

Adds a new HealthBar to be drawn at the given position. The proportion of the red/green bars is determined by percent.

See also:
Hide

ClearVirtices

Parameters:
pos The position at which to draw the health bar.

void HealthBar::Hide (  )  [inline]

Makes the health bar objects invisible, without actually destroying the vertices used to draw the rectangles.

See also:
Draw

ClearVirtices

Definition at line 49 of file HealthBar.h.

References emptyBar, fullBar, and Rect::Hide().

void HealthBar::ClearVertices (  ) 

Deletes all health bars drawn in an object.

See also:
Hide

Draw


Member Data Documentation

Rect* HealthBar::fullBar

Definition at line 30 of file HealthBar.h.

Referenced by ClearVertices(), Draw(), and Hide().

Rect* HealthBar::emptyBar

A green rectangle that represents the "full" part of the bar.

Definition at line 31 of file HealthBar.h.

Referenced by ClearVertices(), Draw(), Hide(), and OgreGFX::UIMgr::UIMgr().

float HealthBar::percent

A red rectangle connected to the green rectangle, representing the "empty" part of the bar

Definition at line 32 of file HealthBar.h.

Referenced by OgreGFX::UIMgr::decorateSelectedEntities(), and Draw().

bool HealthBar::startOnLeft

Percent of the bar that should be shown as full.

Definition at line 33 of file HealthBar.h.

Rect* HealthBar::fullBar

Definition at line 30 of file HealthBar.h.

Rect* HealthBar::emptyBar

A green rectangle that represents the "full" part of the bar.

Definition at line 31 of file HealthBar.h.

Rect* HealthBar::fullBar

Definition at line 30 of file HealthBar.h.

Rect* HealthBar::emptyBar

A green rectangle that represents the "full" part of the bar.

Definition at line 31 of file HealthBar.h.

Rect* HealthBar::fullBar

Definition at line 30 of file HealthBar.h.

Rect* HealthBar::emptyBar

A green rectangle that represents the "full" part of the bar.

Definition at line 31 of file HealthBar.h.

Rect* HealthBar::fullBar

Definition at line 30 of file HealthBar.h.

Rect* HealthBar::emptyBar

A green rectangle that represents the "full" part of the bar.

Definition at line 31 of file HealthBar.h.


The documentation for this class was generated from the following files:
Generated on Fri Dec 13 14:54:19 2013 for FastECSLent by  doxygen 1.5.4