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

#include <ShotgunPelletWidget.hpp>

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

Public Member Functions

 ShotgunPelletWidget ()
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 radius = 18.f
 Pixel radius of the outer ring at uiScale=1.
float dotRadius = 3.5f
 Pixel radius of each pellet dot at uiScale=1.
float holdDuration = 0.45f
 Full opacity hold time after a blast.
float fadeDuration = 0.55f
 Linear fade-out duration after the hold.
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

HudShotgunBlast latest_ {}
 Cached copy of the last blast we displayed.
float alpha_ = 0.f
 Current widget opacity.
float age_ = 0.f
 Seconds since the latest blast was staged.
bool primed_ = false
 False until the first blast arrives.

Constructor & Destructor Documentation

◆ ShotgunPelletWidget()

ShotgunPelletWidget::ShotgunPelletWidget ( )

Member Function Documentation

◆ draw()

void ShotgunPelletWidget::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 ShotgunPelletWidget::update ( float dt,
const HudGameState & state,
HudTweenPool & tweens )
overridevirtual

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

Implements HudWidget.

Member Data Documentation

◆ age_

float ShotgunPelletWidget::age_ = 0.f
private

Seconds since the latest blast was staged.

◆ alpha_

float ShotgunPelletWidget::alpha_ = 0.f
private

Current widget opacity.

◆ dotRadius

float ShotgunPelletWidget::dotRadius = 3.5f

Pixel radius of each pellet dot at uiScale=1.

◆ fadeDuration

float ShotgunPelletWidget::fadeDuration = 0.55f

Linear fade-out duration after the hold.

◆ holdDuration

float ShotgunPelletWidget::holdDuration = 0.45f

Full opacity hold time after a blast.

◆ latest_

HudShotgunBlast ShotgunPelletWidget::latest_ {}
private

Cached copy of the last blast we displayed.

◆ primed_

bool ShotgunPelletWidget::primed_ = false
private

False until the first blast arrives.

◆ radius

float ShotgunPelletWidget::radius = 18.f

Pixel radius of the outer ring at uiScale=1.


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