stamina and health bar

This commit is contained in:
Michael Campbell 2026-03-04 17:17:57 -05:00
parent d17b16ad5b
commit 5b417b540b
9 changed files with 184 additions and 10 deletions

View file

@ -0,0 +1,13 @@
shader_type canvas_item;
void fragment() {
float dist_from_edge_x = .5 - abs(UV.x - .5);
float dist_from_edge_y = .5 - abs(UV.y - .5);
// dist_from_edge in pixels
float dfe_xpx = dist_from_edge_x * 100.;
float dfe_ypx = dist_from_edge_y * 40.;
float dfe_px = min(dfe_xpx, dfe_ypx);
COLOR.a *= dfe_px < 7.5 ? 1. : 0.;
}