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

Shows accumulated damage dealt to the current target. More...

#include <DamageAccumWidget.hpp>

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

Public Member Functions

 DamageAccumWidget ()
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

Private Attributes

int displayTotal_ = 0
float alpha_ = 0.f
HudColor color_ {1.f, 1.f, 1.f, 1.f}
 Matches latest hit type.

Additional Inherited Members

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).

Detailed Description

Shows accumulated damage dealt to the current target.

Positioned just below the crosshair. Hidden when total is 0. Resets after a short delay or when switching targets (handled by Game).

Constructor & Destructor Documentation

◆ DamageAccumWidget()

DamageAccumWidget::DamageAccumWidget ( )

Member Function Documentation

◆ draw()

void DamageAccumWidget::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 DamageAccumWidget::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

◆ alpha_

float DamageAccumWidget::alpha_ = 0.f
private

◆ color_

HudColor DamageAccumWidget::color_ {1.f, 1.f, 1.f, 1.f}
private

Matches latest hit type.

◆ displayTotal_

int DamageAccumWidget::displayTotal_ = 0
private

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