group2
0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
HitMarkerWidget.hpp
Go to the documentation of this file.
1
3
4
#pragma once
5
6
#include "
hud/HudWidget.hpp
"
7
8
struct
HitMarkerWidget
:
HudWidget
9
{
10
float
armLength
= 12.f;
11
float
armThickness
= 2.5f;
12
float
armGap
= 5.f;
13
float
fadeDuration
= 0.35f;
14
15
HitMarkerWidget
();
16
void
update
(
float
dt,
const
HudGameState
& state,
HudTweenPool
& tweens)
override
;
17
void
draw
(
HudContext
& ctx,
float
drawX,
float
drawY)
override
;
18
19
private
:
20
float
alpha_
= 0.f;
21
float
scale_
= 1.f;
22
bool
isHeadshot_
=
false
;
23
bool
shieldBreak_
=
false
;
24
};
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
HitMarkerWidget::update
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition
HitMarkerWidget.cpp:13
HitMarkerWidget::alpha_
float alpha_
Definition
HitMarkerWidget.hpp:20
HitMarkerWidget::armGap
float armGap
Definition
HitMarkerWidget.hpp:12
HitMarkerWidget::draw
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition
HitMarkerWidget.cpp:25
HitMarkerWidget::scale_
float scale_
Definition
HitMarkerWidget.hpp:21
HitMarkerWidget::fadeDuration
float fadeDuration
Definition
HitMarkerWidget.hpp:13
HitMarkerWidget::armLength
float armLength
Definition
HitMarkerWidget.hpp:10
HitMarkerWidget::HitMarkerWidget
HitMarkerWidget()
Definition
HitMarkerWidget.cpp:7
HitMarkerWidget::armThickness
float armThickness
Definition
HitMarkerWidget.hpp:11
HitMarkerWidget::shieldBreak_
bool shieldBreak_
Definition
HitMarkerWidget.hpp:23
HitMarkerWidget::isHeadshot_
bool isHeadshot_
Definition
HitMarkerWidget.hpp:22
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
HitMarkerWidget.hpp
Generated by
1.16.1