group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
HudWidget Struct Referenceabstract

Base class for a retained HUD element. More...

#include <HudWidget.hpp>

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

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
HudColor tint {1.f, 1.f, 1.f, 1.f}
float uiScale_ = 1.f
 Set by Hud each frame (screenH / 1080).

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~HudWidget()

virtual HudWidget::~HudWidget ( )
virtualdefault

Member Function Documentation

◆ draw()

◆ update()

Member Data Documentation

◆ anchor

HudAnchor HudWidget::anchor = HudAnchor::TopLeft

◆ height

float HudWidget::height = 0.f

◆ offsetX

float HudWidget::offsetX = 0.f

◆ offsetY

float HudWidget::offsetY = 0.f

◆ tint

HudColor HudWidget::tint {1.f, 1.f, 1.f, 1.f}

◆ uiScale_

float HudWidget::uiScale_ = 1.f

Set by Hud each frame (screenH / 1080).

◆ visible

bool HudWidget::visible = true

◆ width

float HudWidget::width = 0.f

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