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
6
struct
BuyMenu
:
HudWidget
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
18
private
:
19
bool
isBuyPhase_
=
false
;
20
float
openAlpha_
= 0.f;
21
};
HudWidget.hpp
Base struct for all HUD widgets.
HudContext
Accumulates HUD geometry during a frame for batch rendering.
Definition
HudContext.hpp:18
HudTweenPool
Fixed-size tween pool. No heap allocations.
Definition
HudTween.hpp:35
BuyMenu::toggle
void toggle(bool isBuyPhase)
Definition
BuyMenu.cpp:15
BuyMenu::openAlpha_
float openAlpha_
Definition
BuyMenu.hpp:20
BuyMenu::fontSize
float fontSize
Definition
BuyMenu.hpp:10
BuyMenu::panelHeight
float panelHeight
Definition
BuyMenu.hpp:9
BuyMenu::update
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition
BuyMenu.cpp:24
BuyMenu::panelWidth
float panelWidth
Definition
BuyMenu.hpp:8
BuyMenu::draw
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition
BuyMenu.cpp:35
BuyMenu::isBuyPhase_
bool isBuyPhase_
Definition
BuyMenu.hpp:19
BuyMenu::BuyMenu
BuyMenu()
Definition
BuyMenu.cpp:9
BuyMenu::itemHeight
float itemHeight
Definition
BuyMenu.hpp:11
HudGameState
Snapshot of game state consumed by the HUD each frame.
Definition
HudTypes.hpp:148
HudWidget
Base class for a retained HUD element.
Definition
HudWidget.hpp:16
src
client
hud
widgets
BuyMenu.hpp
Generated by
1.16.1