group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
voidfall Namespace Reference

Namespaces

namespace  icons

Functions

constexpr HudColor weaponTypeAccent (int weaponId)
 Map a weapon-type id (matching WeaponType integer order in ecs/components/WeaponState.hpp: 0=Rifle, 1=Rocket, 2=RailGun, 3=EnergyGun, 4-6=grenades) to its accent color.
constexpr HudColor withAlpha (HudColor c, float alpha)
 Apply alpha to a palette color (for fade-out).
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.
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.
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).
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 filled (so the fill always represents the same slice of the underlying full-bar gradient instead of stretching to the right end).
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.
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.

Variables

constexpr HudColor k_bgVoid {0.08f, 0.075f, 0.07f, 0.96f}
 Deep panel background — opaque so HUD chrome doesn't pick up sky tint.
constexpr HudColor k_bgPanel {0.10f, 0.095f, 0.085f, 0.92f}
 Standard panel fill — bumped to 0.92α (was 0.78).
constexpr HudColor k_bgPanelSolid {0.09f, 0.085f, 0.075f, 0.96f}
 Solid panel — used for hero callouts.
constexpr HudColor k_bgInset {0.12f, 0.115f, 0.105f, 0.92f}
 Inset bar background.
constexpr HudColor k_lineDim {0.32f, 0.30f, 0.28f, 0.7f}
 Dim hairline — oklch(0.32 0.015 60 / 0.6).
constexpr HudColor k_line {0.42f, 0.40f, 0.37f, 0.95f}
 Standard hairline — oklch(0.40 0.018 60).
constexpr HudColor k_lineBright {0.62f, 0.59f, 0.56f, 1.0f}
 Bright hairline — oklch(0.55 0.02 60).
constexpr HudColor k_textDim {0.78f, 0.76f, 0.73f, 1.0f}
 Dim text — bumped luminance from ~0.55 to ~0.78 so secondary readouts (fire mode, "+reserve", "/mag", "[2] PULSAR") read clearly against the panel chrome instead of fading into it.
constexpr HudColor k_text {0.92f, 0.90f, 0.87f, 1.0f}
 Standard text — bumped slightly toward white for body chrome.
constexpr HudColor k_textBright {1.00f, 0.99f, 0.97f, 1.0f}
 Brightest text — kept near-white for hero readouts.
constexpr HudColor k_amber {1.00f, 0.71f, 0.18f, 1.0f}
 Primary amber — oklch(0.80 0.165 75).
constexpr HudColor k_amberDim {0.78f, 0.55f, 0.14f, 1.0f}
 Dimmer amber — oklch(0.65 0.13 75).
constexpr HudColor k_amberDeep {0.50f, 0.35f, 0.10f, 1.0f}
 Deep amber — oklch(0.45 0.10 70).
constexpr HudColor k_amberGlow {1.00f, 0.71f, 0.18f, 0.18f}
 Amber glow tint — oklch(0.80 0.165 75 / 0.15).
constexpr HudColor k_red {0.92f, 0.30f, 0.20f, 1.0f}
 Health red — oklch(0.65 0.20 28).
constexpr HudColor k_redBright {0.95f, 0.45f, 0.25f, 1.0f}
 Bright tail of HP gradient — oklch(0.72 0.18 35).
constexpr HudColor k_redDim {0.65f, 0.20f, 0.15f, 1.0f}
 Dim red — oklch(0.50 0.15 28).
constexpr HudColor k_cyan {0.45f, 0.78f, 0.96f, 1.0f}
 Shield cyan — oklch(0.80 0.10 220).
constexpr HudColor k_cyanDim {0.20f, 0.50f, 0.70f, 1.0f}
 Dim cyan — oklch(0.55 0.08 220).
constexpr HudColor k_green {0.30f, 0.86f, 0.45f, 1.0f}
 Status green — oklch(0.78 0.16 145).
constexpr HudColor k_pickupBg {0.13f, 0.12f, 0.11f, 0.82f}
 Pickup amber-trim background.
constexpr HudColor k_typeAr {0.20f, 0.65f, 0.70f, 1.0f}
constexpr HudColor k_typeSniper {0.40f, 0.30f, 0.75f, 1.0f}
constexpr HudColor k_typePistol {0.20f, 0.75f, 0.45f, 1.0f}
constexpr HudColor k_typeSmg {0.95f, 0.65f, 0.18f, 1.0f}
constexpr HudColor k_typeShotgun {0.85f, 0.30f, 0.20f, 1.0f}

Function Documentation

◆ drawCornerBrackets()

void voidfall::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 )
inline

Draw four mil-spec L-shaped corner brackets around a rect.

Brackets sit slightly outside the rect (offset by outset px) and extend armLen px along each edge. Style: 1 px hairlines, amber by default.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawGradientTrailBar()

void voidfall::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 )
inline

Draw a horizontal stat bar whose live fill is a left→right gradient (e.g.

health: deep red → orange-red, shield: dim cyan → cyan).

fillLeft and fillRight describe the colors for a full (100%) bar. At partial fills the right endpoint of the visible portion is interpolated to fill01 along that gradient — which keeps the warm/bright tail at 100% and the cool/dim head as the bar drains, matching the prototype's linear-gradient(90deg, red, orange-red) CSS behavior.

Here is the caller graph for this function:

◆ drawKeyTab()

void voidfall::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 )
inline

Draw a bordered "key tab" pill with a single character inside.

Used by equipment slots and pickup hints. The text is centered inside the box; sizing is based on the cap-height of the SDF font for visual balance.

◆ drawPanel()

void voidfall::drawPanel ( HudContext & ctx,
float x,
float y,
float w,
float h,
HudColor fill = k_bgPanel,
HudColor border = k_line,
float thickness = 1.f )
inline

Draw a Voidfall panel: solid fill + 1 px outline.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawTrailBar()

void voidfall::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 )
inline

Draw a horizontal stat bar with a damage-trail ghost (solid fill).

Background fill, then a translucent ghost-trail rectangle (where the bar was before the latest damage tick), then the live fill on top. This is the "white ghost draining behind the live red" effect from the design.

◆ lerpColor()

HudColor voidfall::lerpColor ( HudColor a,
HudColor b,
float t )
constexpr

Lerp between two HudColors — used to compute the visible gradient endpoint when the bar is partially filled (so the fill always represents the same slice of the underlying full-bar gradient instead of stretching to the right end).

◆ weaponTypeAccent()

HudColor voidfall::weaponTypeAccent ( int weaponId)
constexpr

Map a weapon-type id (matching WeaponType integer order in ecs/components/WeaponState.hpp: 0=Rifle, 1=Rocket, 2=RailGun, 3=EnergyGun, 4-6=grenades) to its accent color.

Here is the caller graph for this function:

◆ withAlpha()

HudColor voidfall::withAlpha ( HudColor c,
float alpha )
constexpr

Apply alpha to a palette color (for fade-out).

Here is the caller graph for this function:

Variable Documentation

◆ k_amber

HudColor voidfall::k_amber {1.00f, 0.71f, 0.18f, 1.0f}
constexpr

Primary amber — oklch(0.80 0.165 75).

◆ k_amberDeep

HudColor voidfall::k_amberDeep {0.50f, 0.35f, 0.10f, 1.0f}
constexpr

Deep amber — oklch(0.45 0.10 70).

◆ k_amberDim

HudColor voidfall::k_amberDim {0.78f, 0.55f, 0.14f, 1.0f}
constexpr

Dimmer amber — oklch(0.65 0.13 75).

◆ k_amberGlow

HudColor voidfall::k_amberGlow {1.00f, 0.71f, 0.18f, 0.18f}
constexpr

Amber glow tint — oklch(0.80 0.165 75 / 0.15).

◆ k_bgInset

HudColor voidfall::k_bgInset {0.12f, 0.115f, 0.105f, 0.92f}
constexpr

Inset bar background.

◆ k_bgPanel

HudColor voidfall::k_bgPanel {0.10f, 0.095f, 0.085f, 0.92f}
constexpr

Standard panel fill — bumped to 0.92α (was 0.78).

At 0.78 the world bled through enough that bright-sky maps washed the chrome out and made dim text grey-on-grey. 0.92 keeps a faint sense of translucency without sacrificing readability against any background.

◆ k_bgPanelSolid

HudColor voidfall::k_bgPanelSolid {0.09f, 0.085f, 0.075f, 0.96f}
constexpr

Solid panel — used for hero callouts.

◆ k_bgVoid

HudColor voidfall::k_bgVoid {0.08f, 0.075f, 0.07f, 0.96f}
constexpr

Deep panel background — opaque so HUD chrome doesn't pick up sky tint.

◆ k_cyan

HudColor voidfall::k_cyan {0.45f, 0.78f, 0.96f, 1.0f}
constexpr

Shield cyan — oklch(0.80 0.10 220).

◆ k_cyanDim

HudColor voidfall::k_cyanDim {0.20f, 0.50f, 0.70f, 1.0f}
constexpr

Dim cyan — oklch(0.55 0.08 220).

◆ k_green

HudColor voidfall::k_green {0.30f, 0.86f, 0.45f, 1.0f}
constexpr

Status green — oklch(0.78 0.16 145).

◆ k_line

HudColor voidfall::k_line {0.42f, 0.40f, 0.37f, 0.95f}
constexpr

Standard hairline — oklch(0.40 0.018 60).

◆ k_lineBright

HudColor voidfall::k_lineBright {0.62f, 0.59f, 0.56f, 1.0f}
constexpr

Bright hairline — oklch(0.55 0.02 60).

◆ k_lineDim

HudColor voidfall::k_lineDim {0.32f, 0.30f, 0.28f, 0.7f}
constexpr

Dim hairline — oklch(0.32 0.015 60 / 0.6).

◆ k_pickupBg

HudColor voidfall::k_pickupBg {0.13f, 0.12f, 0.11f, 0.82f}
constexpr

Pickup amber-trim background.

◆ k_red

HudColor voidfall::k_red {0.92f, 0.30f, 0.20f, 1.0f}
constexpr

Health red — oklch(0.65 0.20 28).

◆ k_redBright

HudColor voidfall::k_redBright {0.95f, 0.45f, 0.25f, 1.0f}
constexpr

Bright tail of HP gradient — oklch(0.72 0.18 35).

◆ k_redDim

HudColor voidfall::k_redDim {0.65f, 0.20f, 0.15f, 1.0f}
constexpr

Dim red — oklch(0.50 0.15 28).

◆ k_text

HudColor voidfall::k_text {0.92f, 0.90f, 0.87f, 1.0f}
constexpr

Standard text — bumped slightly toward white for body chrome.

◆ k_textBright

HudColor voidfall::k_textBright {1.00f, 0.99f, 0.97f, 1.0f}
constexpr

Brightest text — kept near-white for hero readouts.

◆ k_textDim

HudColor voidfall::k_textDim {0.78f, 0.76f, 0.73f, 1.0f}
constexpr

Dim text — bumped luminance from ~0.55 to ~0.78 so secondary readouts (fire mode, "+reserve", "/mag", "[2] PULSAR") read clearly against the panel chrome instead of fading into it.

◆ k_typeAr

HudColor voidfall::k_typeAr {0.20f, 0.65f, 0.70f, 1.0f}
constexpr

◆ k_typePistol

HudColor voidfall::k_typePistol {0.20f, 0.75f, 0.45f, 1.0f}
constexpr

◆ k_typeShotgun

HudColor voidfall::k_typeShotgun {0.85f, 0.30f, 0.20f, 1.0f}
constexpr

◆ k_typeSmg

HudColor voidfall::k_typeSmg {0.95f, 0.65f, 0.18f, 1.0f}
constexpr

◆ k_typeSniper

HudColor voidfall::k_typeSniper {0.40f, 0.30f, 0.75f, 1.0f}
constexpr