You.i Engine
CYIHud::Bar Class Referencefinal

Detailed Description

A renderable HUD bar. A bar is composed of one or more HUD sections.

See also
CYIHud::Section

#include <debug/YiHud.h>

Public Member Functions

 Bar (CYIHud::BarAlignment alignment)
 
 Bar (Bar &&)=default
 
Baroperator= (Bar &&)=default
 
void AddSection (std::unique_ptr< Section > pSection, bool enabled, float spacing=9.0f)
 
void SetSectionEnabled (HudSection section, bool enabled)
 
bool IsSectionEnabled (HudSection section) const
 
void FrameUpdate ()
 
void PeriodicUpdate ()
 
float Draw (CYIGeometryBatch *pGeometryBatch, glm::vec2 screenSize, float verticalOffset)
 
CYIHud::BarAlignment GetAlignment () const
 

Friends

class CYIHud
 

Constructor & Destructor Documentation

◆ Bar() [1/2]

CYIHud::Bar::Bar ( CYIHud::BarAlignment  alignment)

◆ Bar() [2/2]

CYIHud::Bar::Bar ( Bar &&  )
default

Member Function Documentation

◆ AddSection()

void CYIHud::Bar::AddSection ( std::unique_ptr< Section pSection,
bool  enabled,
float  spacing = 9.0f 
)

Adds a section to this bar with the initial enabled state enabled. The provided spacing is applied only if the section is not the first section within this bar.

◆ Draw()

float CYIHud::Bar::Draw ( CYIGeometryBatch pGeometryBatch,
glm::vec2  screenSize,
float  verticalOffset 
)

Draws this bar and all of its enabled contained sections. This function recursively descends into any contained group sections. Returns the total height of the drawn bar.

◆ FrameUpdate()

void CYIHud::Bar::FrameUpdate ( )

Updates this bar and all of its enabled contained sections. This function is typically called once per frame. This function recursively descends into any contained group sections.

◆ GetAlignment()

CYIHud::BarAlignment CYIHud::Bar::GetAlignment ( ) const

Returns the alignment of this bar. This determines where on the screen the bar is to be positioned.

◆ IsSectionEnabled()

bool CYIHud::Bar::IsSectionEnabled ( HudSection  section) const

Returns true if any of the sections in this bar are of type section and are enabled. This function recursively descends into any contained group sections.

◆ operator=()

Bar& CYIHud::Bar::operator= ( Bar &&  )
default

◆ PeriodicUpdate()

void CYIHud::Bar::PeriodicUpdate ( )

Updates this bar and all of its enabled contained sections. This function is typically called once per second. This function recursively descends into any contained group sections.

◆ SetSectionEnabled()

void CYIHud::Bar::SetSectionEnabled ( HudSection  section,
bool  enabled 
)

Sets all sections with type section to the enabled state enabled. This function recursively descends into any contained group sections.

Friends And Related Function Documentation

◆ CYIHud

friend class CYIHud
friend

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