130 float thickness = 1.f,
134 const float bx = x - outset;
135 const float by = y - outset;
136 const float bw = w + outset * 2.f;
137 const float bh = h + outset * 2.f;
140 ctx.
rect(bx, by, armLen, thickness, color);
141 ctx.
rect(bx, by, thickness, armLen, color);
143 ctx.
rect(bx + bw - armLen, by, armLen, thickness, color);
144 ctx.
rect(bx + bw - thickness, by, thickness, armLen, color);
146 ctx.
rect(bx, by + bh - thickness, armLen, thickness, color);
147 ctx.
rect(bx, by + bh - armLen, thickness, armLen, color);
149 ctx.
rect(bx + bw - armLen, by + bh - thickness, armLen, thickness, color);
150 ctx.
rect(bx + bw - thickness, by + bh - armLen, thickness, armLen, color);
161 float thickness = 1.f)
163 ctx.
rect(x, y, w, h, fill);
185 ctx.
rect(x, y, w, h, bgColor);
187 if (trail01 > fill01)
188 ctx.
rect(x, y, w * trail01, h, trailColor);
191 ctx.
rect(x, y, w * fill01, h, fillColor);
203 a.
r + (b.
r - a.
r) * t,
204 a.
g + (b.
g - a.
g) * t,
205 a.
b + (b.
b - a.
b) * t,
206 a.
a + (b.
a - a.
a) * t,
231 ctx.
rect(x, y, w, h, bgColor);
232 if (trail01 > fill01)
233 ctx.
rect(x, y, w * trail01, h, trailColor);
238 ctx.
gradientRect(x, y, w * fill01, h, fillLeft, visibleRight);
258 const float capH = fontSize * 0.72f;
259 const float w = ctx.
measureText(key, fontSize) + padX * 2.f;
260 const float h = capH + padY * 2.f;
261 ctx.
rect(x, y, w, h, bgColor);
263 ctx.
text(key, x + w * 0.5f, y - fontSize * 0.28f + padY, fontSize, textColor,
HudAlign::Center);
Immediate-mode draw API for HUD widgets.
Shared types for the HUD system.
@ Center
Definition HudTypes.hpp:48
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:18
void text(const char *str, float x, float y, float size, HudColor color, HudAlign align=HudAlign::Left, bool outlined=false)
Render a UTF-8 ASCII string via SDF.
Definition HudContext.cpp:243
float measureText(const char *str, float size) const
Definition HudContext.cpp:310
void rectOutline(float x, float y, float w, float h, float thickness, HudColor color)
Definition HudContext.cpp:138
void gradientRect(float x, float y, float w, float h, HudColor leftColor, HudColor rightColor)
Filled rect with a horizontal color gradient.
Definition HudContext.cpp:146
void rect(float x, float y, float w, float h, HudColor color)
Definition HudContext.cpp:101
Definition HudIcons.cpp:13
constexpr HudColor k_typePistol
Definition VoidfallStyle.hpp:89
constexpr HudColor k_textBright
Brightest text — kept near-white for hero readouts.
Definition VoidfallStyle.hpp:51
constexpr HudColor k_line
Standard hairline — oklch(0.40 0.018 60).
Definition VoidfallStyle.hpp:40
void drawGradientTrailBar(HudContext &ctx, float x, float y, float w, float h, float fill01, float trail01, HudColor fillLeft, HudColor fillRight, HudColor trailColor=HudColor{0.95f, 0.95f, 0.95f, 0.45f}, HudColor bgColor=k_bgInset, HudColor borderColor=k_lineDim)
Draw a horizontal stat bar whose live fill is a left→right gradient (e.g.
Definition VoidfallStyle.hpp:218
constexpr HudColor k_typeSmg
Definition VoidfallStyle.hpp:90
constexpr HudColor weaponTypeAccent(int weaponId)
Map a weapon-type id (matching WeaponType integer order in ecs/components/WeaponState....
Definition VoidfallStyle.hpp:96
void drawCornerBrackets(HudContext &ctx, float x, float y, float w, float h, float armLen=10.f, float thickness=1.f, float outset=0.f, HudColor color=k_amber)
Draw four mil-spec L-shaped corner brackets around a rect.
Definition VoidfallStyle.hpp:124
constexpr HudColor k_bgPanel
Standard panel fill — bumped to 0.92α (was 0.78).
Definition VoidfallStyle.hpp:31
constexpr HudColor k_green
Status green — oklch(0.78 0.16 145).
Definition VoidfallStyle.hpp:75
constexpr HudColor k_amberGlow
Amber glow tint — oklch(0.80 0.165 75 / 0.15).
Definition VoidfallStyle.hpp:60
constexpr HudColor k_redDim
Dim red — oklch(0.50 0.15 28).
Definition VoidfallStyle.hpp:67
void drawTrailBar(HudContext &ctx, float x, float y, float w, float h, float fill01, float trail01, HudColor fillColor, HudColor trailColor=HudColor{0.95f, 0.95f, 0.95f, 0.45f}, HudColor bgColor=k_bgInset, HudColor borderColor=k_lineDim)
Draw a horizontal stat bar with a damage-trail ghost (solid fill).
Definition VoidfallStyle.hpp:172
constexpr HudColor k_lineDim
Dim hairline — oklch(0.32 0.015 60 / 0.6).
Definition VoidfallStyle.hpp:38
constexpr HudColor k_bgInset
Inset bar background.
Definition VoidfallStyle.hpp:35
constexpr HudColor k_cyan
Shield cyan — oklch(0.80 0.10 220).
Definition VoidfallStyle.hpp:70
constexpr HudColor k_bgPanelSolid
Solid panel — used for hero callouts.
Definition VoidfallStyle.hpp:33
constexpr HudColor k_textDim
Dim text — bumped luminance from ~0.55 to ~0.78 so secondary readouts (fire mode, "+reserve",...
Definition VoidfallStyle.hpp:47
void drawKeyTab(HudContext &ctx, const char *key, float x, float y, float fontSize, float padX=3.f, float padY=1.f, HudColor bgColor=HudColor{0.f, 0.f, 0.f, 0.45f}, HudColor borderColor=k_lineBright, HudColor textColor=k_textDim)
Draw a bordered "key tab" pill with a single character inside.
Definition VoidfallStyle.hpp:247
constexpr HudColor k_amber
Primary amber — oklch(0.80 0.165 75).
Definition VoidfallStyle.hpp:54
constexpr HudColor k_amberDeep
Deep amber — oklch(0.45 0.10 70).
Definition VoidfallStyle.hpp:58
constexpr HudColor k_typeShotgun
Definition VoidfallStyle.hpp:91
constexpr HudColor withAlpha(HudColor c, float alpha)
Apply alpha to a palette color (for fade-out).
Definition VoidfallStyle.hpp:113
constexpr HudColor k_lineBright
Bright hairline — oklch(0.55 0.02 60).
Definition VoidfallStyle.hpp:42
constexpr HudColor k_red
Health red — oklch(0.65 0.20 28).
Definition VoidfallStyle.hpp:63
constexpr HudColor k_typeAr
Definition VoidfallStyle.hpp:87
void drawPanel(HudContext &ctx, float x, float y, float w, float h, HudColor fill=k_bgPanel, HudColor border=k_line, float thickness=1.f)
Draw a Voidfall panel: solid fill + 1 px outline.
Definition VoidfallStyle.hpp:154
constexpr HudColor k_pickupBg
Pickup amber-trim background.
Definition VoidfallStyle.hpp:78
constexpr HudColor lerpColor(HudColor a, HudColor b, float t)
Lerp between two HudColors — used to compute the visible gradient endpoint when the bar is partially ...
Definition VoidfallStyle.hpp:200
constexpr HudColor k_redBright
Bright tail of HP gradient — oklch(0.72 0.18 35).
Definition VoidfallStyle.hpp:65
constexpr HudColor k_typeSniper
Definition VoidfallStyle.hpp:88
constexpr HudColor k_amberDim
Dimmer amber — oklch(0.65 0.13 75).
Definition VoidfallStyle.hpp:56
constexpr HudColor k_cyanDim
Dim cyan — oklch(0.55 0.08 220).
Definition VoidfallStyle.hpp:72
constexpr HudColor k_text
Standard text — bumped slightly toward white for body chrome.
Definition VoidfallStyle.hpp:49
constexpr HudColor k_bgVoid
Deep panel background — opaque so HUD chrome doesn't pick up sky tint.
Definition VoidfallStyle.hpp:26
RGBA color for HUD elements (linear space, straight alpha).
Definition HudTypes.hpp:15
float r
Definition HudTypes.hpp:16
float g
Definition HudTypes.hpp:16
float b
Definition HudTypes.hpp:16
float a
Definition HudTypes.hpp:16