group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
AbilitySelectionWidget.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "hud/HudWidget.hpp"
7
8#include <array>
9#include <string>
10
12{
13 float panelWidth = 520.f;
14 float choiceWidth = 244.f;
15 float choiceHeight = 90.f;
16 float choiceGap = 12.f;
17 float headerFontSize = 20.f;
18 float nameFontSize = 20.f;
19 float bodyFontSize = 18.f;
20 float keyFontSize = 18.f;
21
23 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
24 void draw(HudContext& ctx, float drawX, float drawY) override;
25
26private:
28 std::string abilityMenuLabel_ = "Left Alt";
29 // Per visual slot (0 = left card, 1 = right card): which option index it
30 // renders and the key glyph that selects it. On controller the cards swap
31 // so the physically-left trigger picks the left card. Recomputed in update().
32 std::array<int, 2> slotOption_{0, 1};
33 std::array<std::string, 2> slotTag_{"LMB", "RMB"};
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 bodyFontSize
Definition AbilitySelectionWidget.hpp:19
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition AbilitySelectionWidget.cpp:102
std::array< std::string, 2 > slotTag_
Definition AbilitySelectionWidget.hpp:33
float nameFontSize
Definition AbilitySelectionWidget.hpp:18
std::string abilityMenuLabel_
Definition AbilitySelectionWidget.hpp:28
float choiceGap
Definition AbilitySelectionWidget.hpp:16
std::array< int, 2 > slotOption_
Definition AbilitySelectionWidget.hpp:32
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition AbilitySelectionWidget.cpp:22
float choiceHeight
Definition AbilitySelectionWidget.hpp:15
float panelWidth
Definition AbilitySelectionWidget.hpp:13
HudAbilitySelectionState state_
Definition AbilitySelectionWidget.hpp:27
float keyFontSize
Definition AbilitySelectionWidget.hpp:20
float headerFontSize
Definition AbilitySelectionWidget.hpp:17
AbilitySelectionWidget()
Definition AbilitySelectionWidget.cpp:14
float choiceWidth
Definition AbilitySelectionWidget.hpp:14
Definition HudTypes.hpp:281
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:367
Base class for a retained HUD element.
Definition HudWidget.hpp:16