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 float uiScale_ = 1.f;
23
24 virtual ~HudWidget() = default;
25
27 virtual void update(float dt, const HudGameState& state, HudTweenPool& tweens) = 0;
28
33 virtual void draw(HudContext& ctx, float drawX, float drawY) = 0;
34};
Shared types for the HUD system.
HudAnchor
Definition HudTypes.hpp:33
@ TopLeft
Definition HudTypes.hpp:34
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:18
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:148
Base class for a retained HUD element.
Definition HudWidget.hpp:16
float uiScale_
Set by Hud each frame (screenH / 1080).
Definition HudWidget.hpp:22
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