group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
LevelBarWidget.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "hud/HudWidget.hpp"
7
9{
10 float barWidth = 790.5f;
11 float barHeight = 39.5f;
12 float svgScale = 0.95f;
13 float svgOffsetX = 0.f;
14 float svgOffsetY = 0.f;
15 float svgStretchX = 0.57f;
16 float svgStretchY = 1.f;
17 float svgRotationDeg = 0.f;
18
20 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
21 void draw(HudContext& ctx, float drawX, float drawY) override;
22
23private:
24 float progress_ = 0.f;
25};
Base struct for all HUD widgets.
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:19
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:367
Base class for a retained HUD element.
Definition HudWidget.hpp:16
float barWidth
Definition LevelBarWidget.hpp:10
float svgStretchY
Definition LevelBarWidget.hpp:16
LevelBarWidget()
Definition LevelBarWidget.cpp:11
float svgScale
Definition LevelBarWidget.hpp:12
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition LevelBarWidget.cpp:20
float svgOffsetY
Definition LevelBarWidget.hpp:14
float svgRotationDeg
Definition LevelBarWidget.hpp:17
float svgOffsetX
Definition LevelBarWidget.hpp:13
float barHeight
Definition LevelBarWidget.hpp:11
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition LevelBarWidget.cpp:26
float svgStretchX
Definition LevelBarWidget.hpp:15
float progress_
Definition LevelBarWidget.hpp:24