A variable length bar. More...
#include <gui_statusbar.hpp>
Public Types | |
enum | orientation { ORIENT_HORIZONTAL, ORIENT_VERTICAL } |
Public Member Functions | |
status_bar (manager *pManager) | |
Constructor. | |
virtual | ~status_bar () |
Destructor. | |
virtual std::string | serialize (const std::string &sTab) const |
Prints all relevant information about this widget in a string. | |
virtual bool | can_use_script (const std::string &sScriptName) const |
Returns 'true' if this status_bar can use a script. | |
virtual void | copy_from (uiobject *pObj) |
Copies an uiobject's parameters into this status_bar (inheritance). | |
void | set_min_value (float fMin) |
Sets this status_bar's minimum value. | |
void | set_max_value (float fMax) |
Sets this status_bar's maximum value. | |
void | set_min_max_values (float fMin, float fMax) |
Sets this status_bar's value range. | |
void | set_value (float fValue) |
Sets this status_bar's value. | |
void | set_bar_draw_layer (layer_type mBarLayer) |
Sets the draw layer of this status_bar's bar texture. | |
void | set_bar_draw_layer (const std::string &sBarLayer) |
Sets the draw layer of this status_bar's bar texture. | |
void | set_bar_texture (texture *pBarTexture) |
Sets this status_bar's bar texture. | |
void | set_bar_color (const color &mBarColor) |
Sets this status_bar's bar color. | |
void | set_orientation (orientation mOrient) |
Sets this status_bar's orientation. | |
void | set_reversed (bool bReversed) |
Reverses this status_bar. | |
float | get_min_value () const |
Returns this status_bar's minimum value. | |
float | get_max_value () const |
Returns this status_bar's maximum value. | |
float | get_value () const |
Returns this status_bar's value. | |
layer_type | get_bar_draw_layer () const |
Returns the draw layer of status_bar's bar texture. | |
texture * | get_bar_texture () const |
Returns this status_bar's bar texture. | |
const color & | get_bar_color () const |
Returns this status_bar's bar color. | |
orientation | get_orientation () const |
Returns this status_bar's orientation. | |
bool | is_reversed () const |
Checks if this status_bar is reversed. | |
virtual void | create_glue () |
Returns this widget's Lua glue. | |
virtual void | parse_block (xml::block *pBlock) |
Parses data from an xml::block. | |
virtual void | update (float fDelta) |
updates this widget's logic. | |
Static Public Member Functions | |
static void | register_glue (utils::wptr< lua::state > pLua) |
Registers this widget to the provided lua::state. | |
Protected Member Functions | |
texture * | create_bar_texture_ () |
void | fire_update_bar_texture_ () |
Protected Attributes | |
bool | bUpdateBarTexture_ |
orientation | mOrientation_ |
bool | bReversed_ |
float | fValue_ |
float | fMinValue_ |
float | fMaxValue_ |
color | mBarColor_ |
layer_type | mBarLayer_ |
texture * | pBarTexture_ |
std::array< float, 4 > | lInitialTextCoords_ |
A variable length bar.
This is a very simple widget : you give it three values : a minimum and a maximum, and a value between those two. It then Renders a bar that will be full, empty, or anything in between depending on the value.
Can be used to display health or cast bars.
Definition at line 20 of file gui_statusbar.hpp.
Definition at line 24 of file gui_statusbar.hpp.
gui::status_bar::status_bar | ( | manager * | pManager | ) | [explicit] |
Constructor.
Definition at line 15 of file gui_statusbar.cpp.
virtual gui::status_bar::~status_bar | ( | ) | [virtual] |
Destructor.
virtual bool gui::status_bar::can_use_script | ( | const std::string & | sScriptName | ) | const [virtual] |
Returns 'true' if this status_bar can use a script.
sScriptName | The name of the script |
Reimplemented from gui::frame.
virtual void gui::status_bar::copy_from | ( | uiobject * | pObj | ) | [virtual] |
Copies an uiobject's parameters into this status_bar (inheritance).
pObj | The uiobject to copy |
Reimplemented from gui::frame.
texture* gui::status_bar::create_bar_texture_ | ( | ) | [protected] |
virtual void gui::status_bar::create_glue | ( | ) | [virtual] |
Returns this widget's Lua glue.
Reimplemented from gui::frame.
void gui::status_bar::fire_update_bar_texture_ | ( | ) | [protected] |
const color& gui::status_bar::get_bar_color | ( | ) | const |
layer_type gui::status_bar::get_bar_draw_layer | ( | ) | const |
texture* gui::status_bar::get_bar_texture | ( | ) | const |
float gui::status_bar::get_max_value | ( | ) | const |
Returns this status_bar's maximum value.
float gui::status_bar::get_min_value | ( | ) | const |
Returns this status_bar's minimum value.
orientation gui::status_bar::get_orientation | ( | ) | const |
Returns this status_bar's orientation.
float gui::status_bar::get_value | ( | ) | const |
Returns this status_bar's value.
bool gui::status_bar::is_reversed | ( | ) | const |
Checks if this status_bar is reversed.
void gui::status_bar::parse_block | ( | xml::block * | pBlock | ) | [virtual] |
Parses data from an xml::block.
pBlock | The status_bar's xml::block |
Reimplemented from gui::frame.
Definition at line 10 of file gui_statusbar_parser.cpp.
void gui::status_bar::register_glue | ( | utils::wptr< lua::state > | pLua | ) | [static] |
Registers this widget to the provided lua::state.
Definition at line 9 of file gui_statusbar_glues.cpp.
virtual std::string gui::status_bar::serialize | ( | const std::string & | sTab | ) | const [virtual] |
Prints all relevant information about this widget in a string.
sTab | The offset to give to all lines |
Reimplemented from gui::frame.
void gui::status_bar::set_bar_color | ( | const color & | mBarColor | ) |
void gui::status_bar::set_bar_draw_layer | ( | const std::string & | sBarLayer | ) |
void gui::status_bar::set_bar_draw_layer | ( | layer_type | mBarLayer | ) |
void gui::status_bar::set_bar_texture | ( | texture * | pBarTexture | ) |
void gui::status_bar::set_max_value | ( | float | fMax | ) |
Sets this status_bar's maximum value.
fMax | The maximum value |
void gui::status_bar::set_min_max_values | ( | float | fMin, | |
float | fMax | |||
) |
Sets this status_bar's value range.
fMin | The minimum value | |
fMax | The maximum value |
void gui::status_bar::set_min_value | ( | float | fMin | ) |
Sets this status_bar's minimum value.
fMin | The minimum value |
void gui::status_bar::set_orientation | ( | orientation | mOrient | ) |
Sets this status_bar's orientation.
mOrient | The orientation |
void gui::status_bar::set_reversed | ( | bool | bReversed | ) |
Reverses this status_bar.
bReversed | 'true' to reverse it |
void gui::status_bar::set_value | ( | float | fValue | ) |
Sets this status_bar's value.
fValue | The value |
virtual void gui::status_bar::update | ( | float | fDelta | ) | [virtual] |
updates this widget's logic.
Reimplemented from gui::frame.
bool gui::status_bar::bReversed_ [protected] |
Definition at line 170 of file gui_statusbar.hpp.
bool gui::status_bar::bUpdateBarTexture_ [protected] |
Definition at line 167 of file gui_statusbar.hpp.
float gui::status_bar::fMaxValue_ [protected] |
Definition at line 174 of file gui_statusbar.hpp.
float gui::status_bar::fMinValue_ [protected] |
Definition at line 173 of file gui_statusbar.hpp.
float gui::status_bar::fValue_ [protected] |
Definition at line 172 of file gui_statusbar.hpp.
std::array<float,4> gui::status_bar::lInitialTextCoords_ [protected] |
Definition at line 179 of file gui_statusbar.hpp.
color gui::status_bar::mBarColor_ [protected] |
Definition at line 176 of file gui_statusbar.hpp.
layer_type gui::status_bar::mBarLayer_ [protected] |
Definition at line 177 of file gui_statusbar.hpp.
orientation gui::status_bar::mOrientation_ [protected] |
Definition at line 169 of file gui_statusbar.hpp.
texture* gui::status_bar::pBarTexture_ [protected] |
Definition at line 178 of file gui_statusbar.hpp.