56593c58cf
Show touch controls only on touch platforms and keyboard hints only on desktop, via a shared Controls.use_touch_ui() gate (is_touchscreen_available is unreliable with emulate_touch_from_mouse). Bumps version to 0.2.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
673 B
Plaintext
17 lines
673 B
Plaintext
shader_type canvas_item;
|
|
|
|
// Faint red gradient hugging the screen edges, flashed on a hit. `flash` is tweened
|
|
// 0.9 → 0 by the HUD; the vignette is transparent in the centre and reddens toward
|
|
// the corners so the middle of the screen stays clear.
|
|
uniform float flash : hint_range(0.0, 1.0) = 0.0;
|
|
uniform vec3 tint : source_color = vec3(0.75, 0.0, 0.0);
|
|
uniform float inner : hint_range(0.0, 1.0) = 0.45;
|
|
uniform float outer : hint_range(0.0, 1.0) = 1.0;
|
|
|
|
void fragment() {
|
|
// Distance from centre normalised so the corners land at ~1.0.
|
|
float dist = length(UV - vec2(0.5)) / 0.70710678;
|
|
float v = smoothstep(inner, outer, dist);
|
|
COLOR = vec4(tint, v * flash);
|
|
}
|