137 float thickness = 1.f,
141 const float bx = x - outset;
142 const float by = y - outset;
143 const float bw = w + outset * 2.f;
144 const float bh = h + outset * 2.f;
147 ctx.
rect(bx, by, armLen, thickness, color);
148 ctx.
rect(bx, by, thickness, armLen, color);
150 ctx.
rect(bx + bw - armLen, by, armLen, thickness, color);
151 ctx.
rect(bx + bw - thickness, by, thickness, armLen, color);
153 ctx.
rect(bx, by + bh - thickness, armLen, thickness, color);
154 ctx.
rect(bx, by + bh - armLen, thickness, armLen, color);
156 ctx.
rect(bx + bw - armLen, by + bh - thickness, armLen, thickness, color);
157 ctx.
rect(bx + bw - thickness, by + bh - armLen, thickness, armLen, color);
168 float thickness = 1.f)
170 ctx.
rect(x, y, w, h, fill);
192 ctx.
rect(x, y, w, h, bgColor);
194 if (trail01 > fill01)
195 ctx.
rect(x, y, w * trail01, h, trailColor);
198 ctx.
rect(x, y, w * fill01, h, fillColor);
210 a.
r + (b.
r - a.
r) * t,
211 a.
g + (b.
g - a.
g) * t,
212 a.
b + (b.
b - a.
b) * t,
213 a.
a + (b.
a - a.
a) * t,
238 ctx.
rect(x, y, w, h, bgColor);
239 if (trail01 > fill01)
240 ctx.
rect(x, y, w * trail01, h, trailColor);
245 ctx.
gradientRect(x, y, w * fill01, h, fillLeft, visibleRight);
265 const float capH = fontSize * 0.72f;
266 const float w = ctx.
measureText(key, fontSize) + padX * 2.f;
267 const float h = capH + padY * 2.f;
268 ctx.
rect(x, y, w, h, bgColor);
270 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:57
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:19
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:278
float measureText(const char *str, float size) const
Definition HudContext.cpp:382
void rectOutline(float x, float y, float w, float h, float thickness, HudColor color)
Definition HudContext.cpp:173
void gradientRect(float x, float y, float w, float h, HudColor leftColor, HudColor rightColor)
Filled rect with a horizontal color gradient.
Definition HudContext.cpp:181
void rect(float x, float y, float w, float h, HudColor color)
Definition HudContext.cpp:136
Definition HudIcons.cpp:14
constexpr HudColor k_typePistol
Definition VoidfallStyle.hpp:96
constexpr HudColor k_textBright
Brightest text — kept near-white for hero readouts.
Definition VoidfallStyle.hpp:56
constexpr HudColor k_line
Standard hairline — oklch(0.40 0.018 60).
Definition VoidfallStyle.hpp:45
constexpr HudColor k_typeSmg
Definition VoidfallStyle.hpp:97
constexpr HudColor weaponTypeAccent(int weaponId)
Map a weapon-type id (matching WeaponType integer order in ecs/components/WeaponState....
Definition VoidfallStyle.hpp:103
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:131
constexpr HudColor k_bgPanel
Standard panel fill — bumped to 0.92α (was 0.78).
Definition VoidfallStyle.hpp:36
constexpr HudColor k_health
Definition VoidfallStyle.hpp:73
constexpr HudColor k_green
Status green — oklch(0.78 0.16 145).
Definition VoidfallStyle.hpp:82
constexpr HudColor k_amberGlow
Amber glow tint — oklch(0.80 0.165 75 / 0.15).
Definition VoidfallStyle.hpp:65
constexpr HudColor k_secondary
Definition VoidfallStyle.hpp:27
constexpr HudColor k_redDim
Dim red — oklch(0.50 0.15 28).
Definition VoidfallStyle.hpp:72
constexpr HudColor k_lineDim
Dim hairline — oklch(0.32 0.015 60 / 0.6).
Definition VoidfallStyle.hpp:43
constexpr HudColor k_quaternary
Definition VoidfallStyle.hpp:29
constexpr HudColor k_bgInset
Inset bar background.
Definition VoidfallStyle.hpp:40
constexpr HudColor k_cyan
Shield cyan — oklch(0.80 0.10 220).
Definition VoidfallStyle.hpp:77
constexpr HudColor k_primary
Deep panel background — opaque so HUD chrome doesn't pick up sky tint.
Definition VoidfallStyle.hpp:26
constexpr HudColor k_bgPanelSolid
Solid panel — used for hero callouts.
Definition VoidfallStyle.hpp:38
constexpr HudColor k_textDim
Dim text — bumped luminance from ~0.55 to ~0.78 so secondary readouts (fire mode, "+reserve",...
Definition VoidfallStyle.hpp:52
constexpr HudColor k_amber
Primary amber — oklch(0.80 0.165 75).
Definition VoidfallStyle.hpp:59
constexpr HudColor k_amberDeep
Deep amber — oklch(0.45 0.10 70).
Definition VoidfallStyle.hpp:63
constexpr HudColor k_typeShotgun
Definition VoidfallStyle.hpp:98
void drawGradientTrailBar(HudContext &ctx, float x, float y, float w, float h, float fill01, float trail01, HudColor fillLeft, HudColor fillRight, HudColor trailColor=HudColor{k_tertiary.r, k_tertiary.g, k_tertiary.b, 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:225
constexpr HudColor withAlpha(HudColor c, float alpha)
Apply alpha to a palette color (for fade-out).
Definition VoidfallStyle.hpp:120
constexpr HudColor k_lineBright
Bright hairline — oklch(0.55 0.02 60).
Definition VoidfallStyle.hpp:47
constexpr HudColor k_tertiary
Definition VoidfallStyle.hpp:28
void drawKeyTab(HudContext &ctx, const char *key, float x, float y, float fontSize, float padX=3.f, float padY=1.f, HudColor bgColor=HudColor{k_quaternary.r, k_quaternary.g, k_quaternary.b, 0.45f}, HudColor borderColor=k_lineBright, HudColor textColor=k_textDim)
Draw a bordered "key tab" pill with a single character inside.
Definition VoidfallStyle.hpp:254
constexpr HudColor k_red
Health red — oklch(0.65 0.20 28).
Definition VoidfallStyle.hpp:68
constexpr HudColor k_typeAr
Definition VoidfallStyle.hpp:94
constexpr HudColor k_healthBright
Definition VoidfallStyle.hpp:74
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:161
void drawTrailBar(HudContext &ctx, float x, float y, float w, float h, float fill01, float trail01, HudColor fillColor, HudColor trailColor=HudColor{k_tertiary.r, k_tertiary.g, k_tertiary.b, 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:179
constexpr HudColor k_pickupBg
Pickup amber-trim background.
Definition VoidfallStyle.hpp:85
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:207
constexpr HudColor k_redBright
Bright tail of HP gradient — oklch(0.72 0.18 35).
Definition VoidfallStyle.hpp:70
constexpr HudColor k_typeSniper
Definition VoidfallStyle.hpp:95
constexpr HudColor k_amberDim
Dimmer amber — oklch(0.65 0.13 75).
Definition VoidfallStyle.hpp:61
constexpr HudColor k_cyanDim
Dim cyan — oklch(0.55 0.08 220).
Definition VoidfallStyle.hpp:79
constexpr HudColor k_text
Standard text — bumped slightly toward white for body chrome.
Definition VoidfallStyle.hpp:54
constexpr HudColor k_bgVoid
Definition VoidfallStyle.hpp:31
RGBA color for HUD elements (linear space, straight alpha).
Definition HudTypes.hpp:24
float r
Definition HudTypes.hpp:25
float g
Definition HudTypes.hpp:25
float b
Definition HudTypes.hpp:25
float a
Definition HudTypes.hpp:25