A class used to display information on top of the rendered scenes.
This class is used to render one or more information bars on top of the rendered scenes. Each bar is made of one or more section which can display data.
An instance of this class is held by CYIApp and used to display debugging information.
#include <debug/YiHud.h>
Classes | |
class | Bar |
class | Section |
class | SectionGroup |
Public Member Functions | |
CYIHud () | |
Bar * | AddBar (BarAlignment alignment) |
void | SetSectionEnabled (HudSection section, bool enabled) |
bool | IsSectionEnabled (HudSection section) const |
std::vector< const Bar * > | GetBars () const |
std::vector< Bar * > | GetBars () |
Bar * | GetMainBar () |
bool | Update () |
void | Draw () |
Static Public Member Functions | |
static void | SetUserText (const CYIString &text) |
static const CYIString & | GetUserText () |
|
strong |
|
strong |
The type of a HUD section. These types are used to control showing/hiding sections from the HUD dev panel widget.
CYIHud::CYIHud | ( | ) |
Bar* CYIHud::AddBar | ( | BarAlignment | alignment | ) |
Adds a new bar to this HUD instance. The bar will have alignemnt alignment. Multiple bars can be added with the same alignment: in that case, the bars will be drawn vertically offset from each other.
void CYIHud::Draw | ( | ) |
Draws this HUD.
std::vector<const Bar *> CYIHud::GetBars | ( | ) | const |
Returns all bars contained in this HUD. Returns an empty list if this HUD does not contain any bars.
std::vector<Bar *> CYIHud::GetBars | ( | ) |
Bar* CYIHud::GetMainBar | ( | ) |
Returns the first bar contained in this HUD. Returns nullptr if this HUD does not contain any bars.
|
static |
bool CYIHud::IsSectionEnabled | ( | HudSection | section | ) | const |
Returns true if at least one section within this HUD has type section and is enabled.
void CYIHud::SetSectionEnabled | ( | HudSection | section, |
bool | enabled | ||
) |
Sets the enabled status every section with type section to enabled.
|
static |
Sets the text for all HudSection::UserText sections to text. This function is static and does not require a specific CYIHud instance.
bool CYIHud::Update | ( | ) |
Updates this HUD. This function is typically called once per frame. Returns true if a draw should be forced.