group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
EquippedWeaponsWidget Struct Reference

#include <EquippedWeaponsWidget.hpp>

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

Classes

struct  SvgPartTuning
struct  WeaponSlotTuning

Public Member Functions

 EquippedWeaponsWidget ()
void update (float dt, const HudGameState &state, HudTweenPool &tweens) override
 Called each frame before draw(). Update animation, consume events.
void draw (HudContext &ctx, float drawX, float drawY) override
 Emit geometry into the draw context.
Public Member Functions inherited from HudWidget
virtual ~HudWidget ()=default

Public Attributes

float frameWidth = 225.f
float frameHeight = 90.f
float frameGap = 12.5f
float weaponIconWidth = 125.f
float weaponIconHeight = 42.f
std::array< WeaponSlotTuning, 2 > slots {}
Public Attributes inherited from HudWidget
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).

Private Attributes

int primaryWeaponId_ = 0
int secondaryWeaponId_ = 2
int activeWeaponSlot_ = 0

Constructor & Destructor Documentation

◆ EquippedWeaponsWidget()

EquippedWeaponsWidget::EquippedWeaponsWidget ( )

Member Function Documentation

◆ draw()

void EquippedWeaponsWidget::draw ( HudContext & ctx,
float drawX,
float drawY )
overridevirtual

Emit geometry into the draw context.

Parameters
ctxImmediate-mode draw API.
drawXResolved pixel X (anchor + offset already applied).
drawYResolved pixel Y.

Implements HudWidget.

◆ update()

void EquippedWeaponsWidget::update ( float dt,
const HudGameState & state,
HudTweenPool & tweens )
overridevirtual

Called each frame before draw(). Update animation, consume events.

Implements HudWidget.

Member Data Documentation

◆ activeWeaponSlot_

int EquippedWeaponsWidget::activeWeaponSlot_ = 0
private

◆ frameGap

float EquippedWeaponsWidget::frameGap = 12.5f

◆ frameHeight

float EquippedWeaponsWidget::frameHeight = 90.f

◆ frameWidth

float EquippedWeaponsWidget::frameWidth = 225.f

◆ primaryWeaponId_

int EquippedWeaponsWidget::primaryWeaponId_ = 0
private

◆ secondaryWeaponId_

int EquippedWeaponsWidget::secondaryWeaponId_ = 2
private

◆ slots

std::array<WeaponSlotTuning, 2> EquippedWeaponsWidget::slots {}

◆ weaponIconHeight

float EquippedWeaponsWidget::weaponIconHeight = 42.f

◆ weaponIconWidth

float EquippedWeaponsWidget::weaponIconWidth = 125.f

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