|
group2 0.1.0
CSE 125 Group 2
|
Base class for a retained HUD element. More...
#include <HudWidget.hpp>
Public Member Functions | |
| virtual | ~HudWidget ()=default |
| virtual void | update (float dt, const HudGameState &state, HudTweenPool &tweens)=0 |
| Called each frame before draw(). Update animation, consume events. | |
| virtual void | draw (HudContext &ctx, float drawX, float drawY)=0 |
| Emit geometry into the draw context. | |
Public Attributes | |
| 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). | |
Base class for a retained HUD element.
Widgets own their state and animation. Their draw() method uses HudContext's immediate-mode API to emit geometry.
|
virtualdefault |
|
pure virtual |
Emit geometry into the draw context.
| ctx | Immediate-mode draw API. |
| drawX | Resolved pixel X (anchor + offset already applied). |
| drawY | Resolved pixel Y. |
Implemented in AmmoCounter, BuyMenu, CrosshairWidget, DamageAccumWidget, DamageIndicator, DamageNumberWidget, HealthArmorBar, HitMarkerWidget, KillFeed, Minimap, PickupPrompt, RoundTimer, Scoreboard, TeamStatusBar, and VignetteWidget.
|
pure virtual |
Called each frame before draw(). Update animation, consume events.
Implemented in AmmoCounter, BuyMenu, CrosshairWidget, DamageAccumWidget, DamageIndicator, DamageNumberWidget, HealthArmorBar, HitMarkerWidget, KillFeed, Minimap, PickupPrompt, RoundTimer, Scoreboard, TeamStatusBar, and VignetteWidget.
| HudAnchor HudWidget::anchor = HudAnchor::TopLeft |
| float HudWidget::height = 0.f |
| float HudWidget::offsetX = 0.f |
| float HudWidget::offsetY = 0.f |
| float HudWidget::uiScale_ = 1.f |
Set by Hud each frame (screenH / 1080).
| bool HudWidget::visible = true |
| float HudWidget::width = 0.f |