From e09681afecc717d3833412b87048738f42143cbd Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Sun, 15 Jan 2023 14:14:58 -0500 Subject: [PATCH] PIPI --- Bladder.gd | 13 ++++++++++++ Images/Bladder.png | Bin 0 -> 3211 bytes Images/Bladder.png.import | 34 ++++++++++++++++++++++++++++++++ Images/BladderHollow.png | Bin 0 -> 5920 bytes Images/BladderHollow.png.import | 34 ++++++++++++++++++++++++++++++++ bladder.gdshader | 13 ++++++++++++ hud.gd | 11 +++++++++++ hud.gdshader | 9 +++++++++ hud.tscn | 33 +++++++++++++++++++++++++++++++ 9 files changed, 147 insertions(+) create mode 100644 Bladder.gd create mode 100644 Images/Bladder.png create mode 100644 Images/Bladder.png.import create mode 100644 Images/BladderHollow.png create mode 100644 Images/BladderHollow.png.import create mode 100644 bladder.gdshader create mode 100644 hud.gd create mode 100644 hud.gdshader create mode 100644 hud.tscn diff --git a/Bladder.gd b/Bladder.gd new file mode 100644 index 0000000..07e0adb --- /dev/null +++ b/Bladder.gd @@ -0,0 +1,13 @@ +extends Sprite2D + +var fill; + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + material.set("fill",clamp(fill, 0.0, 1.0)) + diff --git a/Images/Bladder.png b/Images/Bladder.png new file mode 100644 index 0000000000000000000000000000000000000000..36ea8b2b323fc4aa921ddbf80e48481ea201b8c5 GIT binary patch literal 3211 zcmV;640Q8}P)Px>D@jB_RCr$PTWgF|JHD0P!^hdq7vy{Hux+~{Yij}^HG4MBzx(c!ISka^2OmV=fdfd`wuEk_upJSAvl|=L z)6175Rb;@a0Kh-n+tGLMAQF}Z%QVLZz?_B#^=xaa0HA3a2*7o_c46<{y(eWRm_L8M z+I-PP$R0WbL)Vc?CdUrIGs~92vTZ?>W0Wiyt~#qmGHL-@{p*oO(BIpOTvr!TsT54Z z7#jdo)R$MT6z``~sj6Alwiu{N7ppxR zHXzs82|ozXP*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IGd5f65R`dRCq3_FR{cgl1$rYIIhJeEX0 zQmzIqmtoDpyv8J0WCar4dQU2 za&>gCTFB_6(H)P7Fpi09l^?a`mk6~Qq4rQlTH30Y_L6MFl(X>T^wIwJQESxpKj5Uq zEAV=f4P&)eDo7%pa@AYw_vk&&+u5oKNN?z^BJzMUy`0c?fD-<+c(Tz&Z{DtC(BI7F~w`z-QEaO7EVlz&iEm9x(P+HL6uU%-o zzvnLCmUqFMo;&31xdtdMonRSAsSDe+6o9bxLT1`yZBNRoyV)*T=Z~+qGgvHVc{<-bFUyv2MT%*v7(3eapPpvl`Ew)l6hneeq&FmQf)p$E`Qm{wi7gc0?j!UO-O0xo0?x z3D|I_>ciW{>XJXq`G)dGJjGQ+$G(9VYwCyj8W&5IAL#7#xkC&c&M}JPsxlJQdv!{l z?G)O}H`o7c(AruTeqhi%0R}5RNjOw2HMI(Uwb3beS>&_b$nEQIsP(qlLzAL=<$}9^ z+g4aMGD+F<&!J}5J#E0%;+}@YC3x>ueX!NRPf71rkL7DASuT;UNqxmy@gP-NM;>4C zJZ32XBt1+Q|4SmTF%jFZYiQ8rxwNIo(PJsNoXCE$(Bt>A%H^F_8&v_<(2;Q+AlEDQ zqb6&=+QgNDOMfl$bT7E}V8VXS=$kc95HtI)1nn*h+C4VI>XJh^Yf;N{D#Xwi9pGT= KLMgJ|necz^v_f_O literal 0 HcmV?d00001 diff --git a/Images/BladderHollow.png.import b/Images/BladderHollow.png.import new file mode 100644 index 0000000..140bd62 --- /dev/null +++ b/Images/BladderHollow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2nqjxofehkum" +path="res://.godot/imported/BladderHollow.png-e4fd50cc80f9ae5a6291ebfabb73f55a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images/BladderHollow.png" +dest_files=["res://.godot/imported/BladderHollow.png-e4fd50cc80f9ae5a6291ebfabb73f55a.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/bladder.gdshader b/bladder.gdshader new file mode 100644 index 0000000..11691d9 --- /dev/null +++ b/bladder.gdshader @@ -0,0 +1,13 @@ +shader_type canvas_item; + +uniform vec4 tex; +uniform float fill; + +void fragment() { + + if ((fill + 0.5) * 0.5 >= 1.0 - UV.y) + COLOR = vec4(0.1, 0.4, 0.4, 1.0); + + COLOR.a = tex.a; +} + diff --git a/hud.gd b/hud.gd new file mode 100644 index 0000000..69a7084 --- /dev/null +++ b/hud.gd @@ -0,0 +1,11 @@ +extends Control + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + $Bladder.fill = 0.3; # <-- value goes here! diff --git a/hud.gdshader b/hud.gdshader new file mode 100644 index 0000000..f8d81eb --- /dev/null +++ b/hud.gdshader @@ -0,0 +1,9 @@ +shader_type canvas_item; + +uniform float fill; + +void fragment() { + if ((fill + 0.5) * 0.5 >= 1.0 - UV.y) + COLOR = vec4(0.1, 0.4, 0.4, texture(TEXTURE, UV).a); + else COLOR = texture(TEXTURE, UV); +} diff --git a/hud.tscn b/hud.tscn new file mode 100644 index 0000000..1520406 --- /dev/null +++ b/hud.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=7 format=3 uid="uid://3n1o2mbywp8w"] + +[ext_resource type="Shader" path="res://hud.gdshader" id="1_0s6h4"] +[ext_resource type="Script" path="res://hud.gd" id="1_jkk58"] +[ext_resource type="Texture2D" uid="uid://b25de1d0yyuji" path="res://Images/Bladder.png" id="2_fa8jy"] +[ext_resource type="Script" path="res://Bladder.gd" id="3_tb31y"] +[ext_resource type="Texture2D" uid="uid://d2nqjxofehkum" path="res://Images/BladderHollow.png" id="4_lbxgy"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_0gcor"] +shader = ExtResource("1_0s6h4") +shader_parameter/fill = 0.0 + +[node name="HUD" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 198.0 +offset_top = 205.0 +offset_right = 198.0 +offset_bottom = 205.0 +script = ExtResource("1_jkk58") + +[node name="Bladder" type="Sprite2D" parent="."] +material = SubResource("ShaderMaterial_0gcor") +scale = Vector2(4, 4) +texture = ExtResource("2_fa8jy") +script = ExtResource("3_tb31y") + +[node name="BladderHollow" type="Sprite2D" parent="."] +position = Vector2(-2, 0) +scale = Vector2(4, 4) +texture = ExtResource("4_lbxgy")