group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
BuyMenu.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "hud/HudWidget.hpp"
5
7{
8 float panelWidth = 450.f;
9 float panelHeight = 380.f;
10 float fontSize = 20.f;
11 float itemHeight = 34.f;
12
13 BuyMenu();
14 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
15 void draw(HudContext& ctx, float drawX, float drawY) override;
16 void toggle(bool isBuyPhase);
17
18private:
19 bool isBuyPhase_ = false;
20 float openAlpha_ = 0.f;
21};
Base struct for all HUD widgets.
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:18
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
void toggle(bool isBuyPhase)
Definition BuyMenu.cpp:15
float openAlpha_
Definition BuyMenu.hpp:20
float fontSize
Definition BuyMenu.hpp:10
float panelHeight
Definition BuyMenu.hpp:9
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition BuyMenu.cpp:24
float panelWidth
Definition BuyMenu.hpp:8
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition BuyMenu.cpp:35
bool isBuyPhase_
Definition BuyMenu.hpp:19
BuyMenu()
Definition BuyMenu.cpp:9
float itemHeight
Definition BuyMenu.hpp:11
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:148
Base class for a retained HUD element.
Definition HudWidget.hpp:16