group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
HudWidget.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "HudTypes.hpp"
7
8class HudContext;
9class HudTweenPool;
10
16{
17 bool visible = true;
18
20 float offsetX = 0.f, offsetY = 0.f;
21 float width = 0.f, height = 0.f;
22 HudColor tint{1.f, 1.f, 1.f, 1.f};
23 float uiScale_ = 1.f;
24
25 virtual ~HudWidget() = default;
26
28 virtual void update(float dt, const HudGameState& state, HudTweenPool& tweens) = 0;
29
34 virtual void draw(HudContext& ctx, float drawX, float drawY) = 0;
35};
Shared types for the HUD system.
HudAnchor
Definition HudTypes.hpp:42
@ TopLeft
Definition HudTypes.hpp:43
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:19
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
RGBA color for HUD elements (linear space, straight alpha).
Definition HudTypes.hpp:24
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
HudColor tint
Definition HudWidget.hpp:22
float uiScale_
Set by Hud each frame (screenH / 1080).
Definition HudWidget.hpp:23
float height
Definition HudWidget.hpp:21
float offsetY
Definition HudWidget.hpp:20
bool visible
Definition HudWidget.hpp:17
virtual void draw(HudContext &ctx, float drawX, float drawY)=0
Emit geometry into the draw context.
float width
Definition HudWidget.hpp:21
HudAnchor anchor
Definition HudWidget.hpp:19
float offsetX
Definition HudWidget.hpp:20
virtual void update(float dt, const HudGameState &state, HudTweenPool &tweens)=0
Called each frame before draw(). Update animation, consume events.
virtual ~HudWidget()=default