group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
HealthArmorBar Struct Reference

#include <HealthArmorBar.hpp>

Inheritance diagram for HealthArmorBar:
[legend]
Collaboration diagram for HealthArmorBar:
[legend]

Public Member Functions

 HealthArmorBar ()
void update (float dt, const HudGameState &state, HudTweenPool &tweens) override
 Called each frame before draw(). Update animation, consume events.
void draw (HudContext &ctx, float drawX, float drawY) override
 Emit geometry into the draw context.
Public Member Functions inherited from HudWidget
virtual ~HudWidget ()=default

Public Attributes

float barWidth = 260.f
float barHeight = 20.f
float barSpacing = 6.f
float fontSize = 22.f
float textPadding = 8.f
Public Attributes inherited from HudWidget
bool visible = true
HudAnchor anchor = HudAnchor::TopLeft
float offsetX = 0.f
float offsetY = 0.f
float width = 0.f
float height = 0.f
float uiScale_ = 1.f
 Set by Hud each frame (screenH / 1080).

Private Attributes

float healthFill_ = 1.f
float armorFill_ = 0.f
int lastHealth_ = 100
int lastArmor_ = 0
int displayHealth_ = 100
int displayArmor_ = 0

Constructor & Destructor Documentation

◆ HealthArmorBar()

HealthArmorBar::HealthArmorBar ( )

Member Function Documentation

◆ draw()

void HealthArmorBar::draw ( HudContext & ctx,
float drawX,
float drawY )
overridevirtual

Emit geometry into the draw context.

Parameters
ctxImmediate-mode draw API.
drawXResolved pixel X (anchor + offset already applied).
drawYResolved pixel Y.

Implements HudWidget.

Here is the call graph for this function:

◆ update()

void HealthArmorBar::update ( float dt,
const HudGameState & state,
HudTweenPool & tweens )
overridevirtual

Called each frame before draw(). Update animation, consume events.

Implements HudWidget.

Here is the call graph for this function:

Member Data Documentation

◆ armorFill_

float HealthArmorBar::armorFill_ = 0.f
private

◆ barHeight

float HealthArmorBar::barHeight = 20.f

◆ barSpacing

float HealthArmorBar::barSpacing = 6.f

◆ barWidth

float HealthArmorBar::barWidth = 260.f

◆ displayArmor_

int HealthArmorBar::displayArmor_ = 0
private

◆ displayHealth_

int HealthArmorBar::displayHealth_ = 100
private

◆ fontSize

float HealthArmorBar::fontSize = 22.f

◆ healthFill_

float HealthArmorBar::healthFill_ = 1.f
private

◆ lastArmor_

int HealthArmorBar::lastArmor_ = 0
private

◆ lastHealth_

int HealthArmorBar::lastHealth_ = 100
private

◆ textPadding

float HealthArmorBar::textPadding = 8.f

The documentation for this struct was generated from the following files: