You.i Engine
CYIHud::SectionGroup Class Reference

Detailed Description

A renderable group of HUD sections. A section group can be used when multiple sections need access to the same data.

#include <debug/YiHud.h>

Inheritance diagram for CYIHud::SectionGroup:

Public Member Functions

 SectionGroup ()
 
void AddSection (std::unique_ptr< Section > pSection, bool enabled, float spacing=9.0f)
 
bool IsLogicallyDisabled () const
 
bool SetSectionEnabled (HudSection section, bool enabled)
 
bool IsSectionEnabled (HudSection section) const
 
virtual void FrameUpdate () override
 
virtual void PeriodicUpdate () override
 
virtual void Draw (CYIGeometryBatch *pGeometryBatch, glm::vec2 topLeft) override
 
- Public Member Functions inherited from CYIHud::Section
 Section (const CYIString &initialText, HudSection sectionType=HudSection::UserSection, const CYIColor &textColor=CYIColor::Named().White)
 
virtual ~Section ()
 
HudSection GetSectionType () const
 
float GetWidth () const
 

Protected Attributes

bool m_logicallyDisabled
 
- Protected Attributes inherited from CYIHud::Section
CYIString m_text
 
CYIColor m_textColor
 
HudSection m_sectionType
 

Friends

class Bar
 

Additional Inherited Members

- Protected Member Functions inherited from CYIHud::Section
SectionGroupGetParentGroup ()
 

Constructor & Destructor Documentation

◆ SectionGroup()

CYIHud::SectionGroup::SectionGroup ( )

Member Function Documentation

◆ AddSection()

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

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

◆ Draw()

virtual void CYIHud::SectionGroup::Draw ( CYIGeometryBatch pGeometryBatch,
glm::vec2  topLeft 
)
overridevirtual

Draws this section at topLeft. The provided pGeometryBatch already has had its Begin() function called.

Implements CYIHud::Section.

◆ FrameUpdate()

virtual void CYIHud::SectionGroup::FrameUpdate ( )
overridevirtual

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.

Reimplemented from CYIHud::Section.

◆ IsLogicallyDisabled()

bool CYIHud::SectionGroup::IsLogicallyDisabled ( ) const

Returns true if this section group is logically disabled. A section group is logically disabled if m_logicallyDisabled is set to true, and indicates that this section group (and its child sections) should not be drawn. Logically disabled section groups (and their child sections) stil get update calls.

◆ IsSectionEnabled()

bool CYIHud::SectionGroup::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.

◆ PeriodicUpdate()

virtual void CYIHud::SectionGroup::PeriodicUpdate ( )
overridevirtual

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.

Reimplemented from CYIHud::Section.

◆ SetSectionEnabled()

bool CYIHud::SectionGroup::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

◆ Bar

friend class Bar
friend

Member Data Documentation

◆ m_logicallyDisabled

bool CYIHud::SectionGroup::m_logicallyDisabled
protected

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