Skip to content

Resource HUD Effects & Reactions

Resource presentation has two independent ordered stacks:

  • effects run continuously while the meter is visible.
  • reactions play when its value or owning ability changes.

That lets a flowing or runed meter keep its identity while a low-resource warning, spend flash, or readiness sweep plays over it.

Effects render in array order. An empty array is the plain fill; townstead:none is accepted but contributes no layer.

EffectBehaviourAdditional fields
townstead:gradientShades the fill without changing its authored base hue.preset, strength, shape, highlight_color, shadow_color
townstead:shimmerSends a timed reflective highlight across the fill.strength, speed, interval, color
townstead:pulseBreathes the fill’s brightness in and out.strength, speed, color
townstead:flowMoves a directional current through the fill.strength, speed, color
townstead:liquidSimulates a connected pixel-art liquid surface that tilts, settles, and splashes on value changes.strength, speed, color, surface_points, tension, damping, splash, movement_influence
townstead:viscousGives the fill slow sticky lobes and trailing strands.strength, speed, color, lobes, viscosity, stringiness
townstead:bubblesRaises wobbling bubbles through the fill.strength, speed, color, density, size, wobble
townstead:embersEmits hot pixels that cool, drift, and may escape beyond the frame.strength, speed, density, drift, flicker, escape, hot_color, cool_color
townstead:flamesBuilds pixel flame tongues from the selected edge.strength, speed, density, height, flicker, placement, hot_color, cool_color
townstead:steamReleases pale, soft water-vapour puffs rather than dark smoke.strength, speed, density, size, drift, color
townstead:electricSends coherent travelling arcs through the fill, with anchored forks and a brief afterglow.strength, speed, density, branching, reach, color
townstead:wispsDrifts spectral motes with short luminous trails.strength, speed, density, trail, wander, color
townstead:sparkleProduces crisp, intermittent pixel stars.strength, speed, density, size, twinkle, color
townstead:crystallineLayers a dark geode base, translucent facets, and travelling prismatic glints.strength, speed, density, depth, glint, color
townstead:runesScrolls or blinks glyphs inside the fill while some glyphs escape around it.strength, speed, color, mode, spacing, escape, glyph-sheet fields
townstead:corruptionCrawling pixel noise consumes and releases small fill patches without changing the value.strength, speed, density, size, color
townstead:voidRandomly deletes and displaces pixels for an unstable glitch, without adding stars.strength, speed, density, instability
townstead:prismaticSends a controlled hue band through the fill. This is the one effect intended to alter the authored hue.strength, speed, band_width
townstead:sporesDrifts soft biological motes outward in every direction.strength, speed, density, size, drift, color
townstead:falling_motesDrops dust, snow, ash, petals, or textured marks through and beyond the bar.strength, speed, density, size, drift, color, mark-sheet fields

Most numerical effect controls are normalized around 0 to 1; counts and pixel sizes are small integers. Townstead clamps unsafe values. Start from the defaults by declaring only type, then tune the few properties that change the effect’s character.

gradient has five presets:

PresetResult
subtleLight crosswise shading.
standardGeneral-purpose crosswise shading.
deepStronger light-to-shadow range.
glossyA centred glass-like highlight.
leading_edgeConcentrates light near the current fill boundary.

For manual control, shape accepts crosswise, along, centered, leading_edge, or radial. Explicit strength, highlight_color, and shadow_color values override the preset’s corresponding choices.

liquid uses 8 to 16 connected surface points in typical use. Spring tension spreads motion between points, damping makes the surface settle, mana gain or loss applies a splash impulse, and player movement can influence tilt.

{
"type": "townstead:liquid",
"strength": 0.45,
"speed": 1.0,
"surface_points": 12,
"tension": 0.18,
"damping": 0.92,
"splash": 0.65,
"movement_influence": 0.2
}

The renderer turns that surface into deliberate pixel-art steps. Thicker frames give the movement more room to read.

runes can use a resource-pack glyph sheet:

{
"type": "townstead:runes",
"mode": "scroll",
"texture": "my_pack:textures/gui/resource_effect/moon_runes.png",
"glyph_width": 5,
"glyph_height": 7,
"columns": 8,
"rows": 2,
"spacing": 3,
"escape": 0.45
}

mode is scroll or blink. If texture is absent, Townstead uses its built-in tiny glyphs.

falling_motes uses the same atlas pattern with texture, mark_width, mark_height, columns, and rows. This lets a resource pack replace generic motes with petals, ash flakes, snow clumps, leaves, or another authored mark.

"effects": [
{ "type": "townstead:gradient", "preset": "deep" },
{ "type": "townstead:flow", "strength": 0.25, "speed": 0.8 },
{ "type": "townstead:runes", "strength": 0.5, "mode": "blink" },
{ "type": "townstead:shimmer", "strength": 0.2, "interval": 4.5 }
]

The order is meaningful. Begin with broad fill treatments such as gradient or flow, then add glyphs and particles, and finish with narrow highlights such as shimmer. There is no hard requirement to use that order, but it is the easiest stack to reason about.

ReactionTrigger and behaviour
townstead:gain_flashA highlight begins at the old value and travels toward the new value.
townstead:spend_flashThe removed portion lingers briefly, then dissolves or flashes.
townstead:change_rippleSends a brightness ripple across the meter whenever its value changes.
townstead:full_chargePlays a flash, pulse, sparkle burst, or edge sweep when the value reaches maximum.
townstead:low_warningPulses or flickers below threshold. It does not force the meter red unless color says so.
townstead:empty_warningPlays once on reaching minimum, with an optional subdued continuing state.
townstead:regeneration_tickProduces a small travelling glint or particle for each regeneration step.
townstead:ability_readyPlays a stronger response when the owning ability becomes usable, not merely when the meter is full.

All reactions accept strength, duration, speed, and optional color. low_warning also uses threshold, expressed from 0 to 1, and supports pulse or flicker. full_charge and ability_ready support flash, pulse, sparkle_burst, or edge_sweep. Spend, regeneration, and empty reactions currently use their fixed dissolve, glint, and flash treatments. continuing controls the subdued state used after an empty warning.

"reactions": [
{
"type": "townstead:gain_flash",
"strength": 0.7,
"duration": 0.55
},
{
"type": "townstead:low_warning",
"threshold": 0.18,
"mode": "flicker",
"color": "#FFD27A"
},
{
"type": "townstead:ability_ready",
"mode": "edge_sweep",
"strength": 0.95
}
]

Reactions report gameplay changes without altering the displayed value. A spend linger, corruption patch, or void deletion is always visual only.