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 panelWidth = 630.f
 Base SVG frame width.
float barHeight = 40.f
 Base SVG frame height.
float svgScale = 1.f
 Extra scale applied to both SVG frame layers.
float svgOffsetX = 0.f
 SVG frame X adjustment.
float svgOffsetY = 0.f
 SVG frame Y adjustment.
float svgStretchX = 1.f
 Horizontal SVG stretch multiplier.
float svgStretchY = 1.f
 Vertical SVG stretch multiplier.
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
HudColor tint {1.f, 1.f, 1.f, 1.f}
float uiScale_ = 1.f
 Set by Hud each frame (screenH / 1080).

Private Attributes

int maxHealth_ = 100
int maxArmor_ = 100
int maxOverShield_ = 200
float healthFill_ = 1.f
float armorFill_ = 0.f
float overShieldFill_ = 0.f

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.

Member Data Documentation

◆ armorFill_

float HealthArmorBar::armorFill_ = 0.f
private

◆ barHeight

float HealthArmorBar::barHeight = 40.f

Base SVG frame height.

◆ healthFill_

float HealthArmorBar::healthFill_ = 1.f
private

◆ maxArmor_

int HealthArmorBar::maxArmor_ = 100
private

◆ maxHealth_

int HealthArmorBar::maxHealth_ = 100
private

◆ maxOverShield_

int HealthArmorBar::maxOverShield_ = 200
private

◆ overShieldFill_

float HealthArmorBar::overShieldFill_ = 0.f
private

◆ panelWidth

float HealthArmorBar::panelWidth = 630.f

Base SVG frame width.

◆ svgOffsetX

float HealthArmorBar::svgOffsetX = 0.f

SVG frame X adjustment.

◆ svgOffsetY

float HealthArmorBar::svgOffsetY = 0.f

SVG frame Y adjustment.

◆ svgScale

float HealthArmorBar::svgScale = 1.f

Extra scale applied to both SVG frame layers.

◆ svgStretchX

float HealthArmorBar::svgStretchX = 1.f

Horizontal SVG stretch multiplier.

◆ svgStretchY

float HealthArmorBar::svgStretchY = 1.f

Vertical SVG stretch multiplier.


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