group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
PopupNotification.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "hud/HudWidget.hpp"
7
8#include <string>
9#include <vector>
10
12{
13 float entryHeight = 30.f;
14 float entryGap = 6.f;
15 float entryFontSize = 13.f;
16 float entryLifetime = 4.f;
17 float fadeOut = 0.65f;
18 int maxEntries = 3;
19
22
24 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
25
27 void draw(HudContext& ctx, float drawX, float drawY) override;
28
29private:
30 struct Entry
31 {
33 std::string text;
34 float timer = 0.f;
35 float slideIn = 0.f;
36 };
37
38 std::vector<Entry> entries_;
39};
HudPopupKind
Visual category for generic transient HUD popup messages.
Definition HudTypes.hpp:109
@ Info
Neutral informational popup.
Definition HudTypes.hpp:110
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
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
Definition PopupNotification.hpp:31
float timer
Remaining visible lifetime in seconds.
Definition PopupNotification.hpp:34
HudPopupKind kind
Styling category copied from the HUD event.
Definition PopupNotification.hpp:32
std::string text
Display text copied from the HUD event.
Definition PopupNotification.hpp:33
float slideIn
0..1 slide/fade-in interpolation value.
Definition PopupNotification.hpp:35
float entryGap
Vertical spacing between stacked popup pills.
Definition PopupNotification.hpp:14
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Consume this-frame popup messages and advance retained popup lifetimes.
Definition PopupNotification.cpp:41
float entryHeight
Height of each popup pill in 1080p-scaled HUD units.
Definition PopupNotification.hpp:13
void draw(HudContext &ctx, float drawX, float drawY) override
Draw active popup pills centered around the resolved HUD anchor.
Definition PopupNotification.cpp:68
float entryLifetime
Seconds each popup remains alive.
Definition PopupNotification.hpp:16
PopupNotification()
Construct the popup feed anchored above the bottom-center ability bar.
Definition PopupNotification.cpp:34
float fadeOut
Seconds used for the final fade-out.
Definition PopupNotification.hpp:17
float entryFontSize
Popup text size in 1080p-scaled HUD units.
Definition PopupNotification.hpp:15
std::vector< Entry > entries_
Definition PopupNotification.hpp:38
int maxEntries
Maximum simultaneous popup pills retained.
Definition PopupNotification.hpp:18