stamina and health bar
This commit is contained in:
parent
d17b16ad5b
commit
5b417b540b
9 changed files with 184 additions and 10 deletions
13
player/hp_outline.gdshader
Normal file
13
player/hp_outline.gdshader
Normal 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.;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue