diff --git a/components/Abstracts/SkillIconBase.tscn b/components/Abstracts/SkillIconBase.tscn new file mode 100644 index 0000000..c7d86b9 --- /dev/null +++ b/components/Abstracts/SkillIconBase.tscn @@ -0,0 +1,32 @@ +[gd_scene load_steps=5 format=3 uid="uid://ufl4kek8hrmt"] + +[ext_resource type="Shader" path="res://shaders/CooldownProgress.gdshader" id="1_jaivk"] +[ext_resource type="Texture2D" uid="uid://cp4ypuarjoshp" path="res://resources/skillIcons/purple-crystal.png" id="2_hh1bl"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_a60wd"] +content_margin_left = 5.0 +content_margin_top = 5.0 +content_margin_right = 5.0 +content_margin_bottom = 5.0 +bg_color = Color(0, 0, 0, 0.5) +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_ew32n"] +shader = ExtResource("1_jaivk") +shader_parameter/progress = 0.58 + +[node name="SkillIconBase" type="PanelContainer"] +custom_minimum_size = Vector2(30, 30) +offset_right = 30.0 +offset_bottom = 30.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_a60wd") + +[node name="icon" type="TextureRect" parent="."] +material = SubResource("ShaderMaterial_ew32n") +layout_mode = 2 +texture = ExtResource("2_hh1bl") +expand_mode = 1 +stretch_mode = 5 diff --git a/resources/skillIcons/purple-crystal.png b/resources/skillIcons/purple-crystal.png new file mode 100644 index 0000000..a4e733e Binary files /dev/null and b/resources/skillIcons/purple-crystal.png differ diff --git a/resources/skillIcons/purple-crystal.png.import b/resources/skillIcons/purple-crystal.png.import new file mode 100644 index 0000000..157cccd --- /dev/null +++ b/resources/skillIcons/purple-crystal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cp4ypuarjoshp" +path="res://.godot/imported/purple-crystal.png-f9e8d81cb38093f7cc1a3de123d1cd24.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/skillIcons/purple-crystal.png" +dest_files=["res://.godot/imported/purple-crystal.png-f9e8d81cb38093f7cc1a3de123d1cd24.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +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/shaders/CooldownProgress.gdshader b/shaders/CooldownProgress.gdshader new file mode 100644 index 0000000..8b76655 --- /dev/null +++ b/shaders/CooldownProgress.gdshader @@ -0,0 +1,8 @@ +shader_type canvas_item; +uniform float progress:hint_range(0.0, 1.0, 0.01)=0.5; +void fragment() { + COLOR=texture(TEXTURE,UV); + if(UV.y>=progress){ + COLOR.a*=0.5; + } +} \ No newline at end of file