group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
GrenadeSlotsWidget.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "hud/HudWidget.hpp"
7
9{
10 float slotSize = 70.f;
11 float slotGap = 23.5f;
12 float iconSize = 40.f;
13 float countFontSize = 20.f;
14 float countPadX = 9.f;
15 float countPadY = 5.f;
16 float countCharacterGap = 3.25f;
17 float iconPadRight = 3.f;
18 float elementsRotationDeg = 11.5f;
19 float backgroundWidth = 226.f;
20 float backgroundHeight = 70.f;
21 float backgroundScale = 2.25f;
22 float backgroundOffsetX = -135.f;
23 float backgroundOffsetY = -44.5f;
24 float backgroundStretchX = 0.55f;
25 float backgroundStretchY = 1.f;
27
29 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
30 void draw(HudContext& ctx, float drawX, float drawY) override;
31
32private:
34};
Base struct for all HUD widgets.
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:19
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
float backgroundWidth
Definition GrenadeSlotsWidget.hpp:19
float backgroundOffsetY
Definition GrenadeSlotsWidget.hpp:23
float elementsRotationDeg
Definition GrenadeSlotsWidget.hpp:18
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition GrenadeSlotsWidget.cpp:55
float slotGap
Definition GrenadeSlotsWidget.hpp:11
HudGrenadeRadialState state_
Definition GrenadeSlotsWidget.hpp:33
float backgroundStretchY
Definition GrenadeSlotsWidget.hpp:25
float countFontSize
Definition GrenadeSlotsWidget.hpp:13
float backgroundStretchX
Definition GrenadeSlotsWidget.hpp:24
float countPadX
Definition GrenadeSlotsWidget.hpp:14
float backgroundHeight
Definition GrenadeSlotsWidget.hpp:20
float backgroundRotationDeg
Definition GrenadeSlotsWidget.hpp:26
GrenadeSlotsWidget()
Definition GrenadeSlotsWidget.cpp:40
float countPadY
Definition GrenadeSlotsWidget.hpp:15
float backgroundOffsetX
Definition GrenadeSlotsWidget.hpp:22
float backgroundScale
Definition GrenadeSlotsWidget.hpp:21
float countCharacterGap
Definition GrenadeSlotsWidget.hpp:16
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition GrenadeSlotsWidget.cpp:49
float iconSize
Definition GrenadeSlotsWidget.hpp:12
float iconPadRight
Definition GrenadeSlotsWidget.hpp:17
float slotSize
Definition GrenadeSlotsWidget.hpp:10
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:367
Definition HudTypes.hpp:258
Base class for a retained HUD element.
Definition HudWidget.hpp:16