wonky polygon ui rework
This commit is contained in:
parent
6bdc9617b2
commit
6c55d719ff
22 changed files with 165 additions and 117 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
[ext_resource type="Texture2D" uid="uid://dumlc4mcwmlke" path="res://src/level/tiles.png" id="7_y2hwx"]
|
[ext_resource type="Texture2D" uid="uid://dumlc4mcwmlke" path="res://src/level/tiles.png" id="7_y2hwx"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cbr6glix407xt" path="res://src/level/water_area.tscn" id="8_uktfx"]
|
[ext_resource type="PackedScene" uid="uid://cbr6glix407xt" path="res://src/level/water_area.tscn" id="8_uktfx"]
|
||||||
[ext_resource type="Shader" uid="uid://dxyevul4ilojm" path="res://src/level/water.gdshader" id="9_y2hwx"]
|
[ext_resource type="Shader" uid="uid://dxyevul4ilojm" path="res://src/level/water.gdshader" id="9_y2hwx"]
|
||||||
[ext_resource type="PackedScene" uid="uid://llohfwmma2hv" path="res://src/player/ui/player_hud.tscn" id="11_y2hwx"]
|
[ext_resource type="PackedScene" uid="uid://llohfwmma2hv" path="res://src/ui/player_hud.tscn" id="11_y2hwx"]
|
||||||
|
|
||||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_wqvko"]
|
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_wqvko"]
|
||||||
texture = ExtResource("7_y2hwx")
|
texture = ExtResource("7_y2hwx")
|
||||||
|
|
@ -146,7 +146,7 @@ resource_local_to_scene = true
|
||||||
shader = ExtResource("9_y2hwx")
|
shader = ExtResource("9_y2hwx")
|
||||||
shader_parameter/water = Color(0.31764707, 0.5921569, 0.6431373, 0.64705884)
|
shader_parameter/water = Color(0.31764707, 0.5921569, 0.6431373, 0.64705884)
|
||||||
shader_parameter/highlights = Color(0.51546186, 0.75253254, 0.7743172, 1)
|
shader_parameter/highlights = Color(0.51546186, 0.75253254, 0.7743172, 1)
|
||||||
shader_parameter/top_border = 12.799999
|
shader_parameter/top_border = 0.0
|
||||||
|
|
||||||
[node name="Game" type="Node2D" unique_id=1186062666]
|
[node name="Game" type="Node2D" unique_id=1186062666]
|
||||||
script = ExtResource("1_kc8ui")
|
script = ExtResource("1_kc8ui")
|
||||||
|
|
@ -211,7 +211,6 @@ position = Vector2(16, 32)
|
||||||
material = SubResource("ShaderMaterial_y2hwx")
|
material = SubResource("ShaderMaterial_y2hwx")
|
||||||
position = Vector2(-624, 0)
|
position = Vector2(-624, 0)
|
||||||
polygon = PackedVector2Array(0, 0, 256, 0, 256, 32, 0, 32)
|
polygon = PackedVector2Array(0, 0, 256, 0, 256, 32, 0, 32)
|
||||||
FillLevel = 0.6
|
|
||||||
|
|
||||||
[node name="Rain4" type="Sprite2D" parent="World/Overlay" unique_id=940148613]
|
[node name="Rain4" type="Sprite2D" parent="World/Overlay" unique_id=940148613]
|
||||||
physics_interpolation_mode = 2
|
physics_interpolation_mode = 2
|
||||||
|
|
|
||||||
|
|
@ -260,13 +260,11 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
||||||
|
|
||||||
public void OnEnteredWater(Node2D body)
|
public void OnEnteredWater(Node2D body)
|
||||||
{
|
{
|
||||||
GD.Print("Entered water");
|
|
||||||
IsInWater = true;
|
IsInWater = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnLeftWater(Node2D body)
|
public void OnLeftWater(Node2D body)
|
||||||
{
|
{
|
||||||
GD.Print("Left water");
|
|
||||||
if (!IsInWater || SubmersedSensor.HasOverlappingBodies()) return;
|
if (!IsInWater || SubmersedSensor.HasOverlappingBodies()) return;
|
||||||
IsInWater = false;
|
IsInWater = false;
|
||||||
WaterJumpAllowedTimer.Start();
|
WaterJumpAllowedTimer.Start();
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
namespace Dancer;
|
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
|
||||||
public partial class PlayerHud : Control
|
|
||||||
{
|
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
|
||||||
|
|
||||||
[Export] private Player Player { get; set; } = null!;
|
|
||||||
|
|
||||||
[Node] private TextureProgressBar HpBar { get; set; } = null!;
|
|
||||||
[Node] private TextureProgressBar EnergyBar0 { get; set; } = null!;
|
|
||||||
[Node] private TextureProgressBar EnergyBar1 { get; set; } = null!;
|
|
||||||
[Node] private TextureProgressBar EnergyBar2 { get; set; } = null!;
|
|
||||||
|
|
||||||
public void OnReady() => SetProcess(true);
|
|
||||||
|
|
||||||
public void OnProcess(double delta)
|
|
||||||
{
|
|
||||||
HpBar.MinValue = 0f;
|
|
||||||
HpBar.MaxValue = Player.MaxHealth;
|
|
||||||
HpBar.Value = Player.Health;
|
|
||||||
|
|
||||||
EnergyBar0.MinValue = 0f;
|
|
||||||
EnergyBar0.MaxValue = 1f;
|
|
||||||
EnergyBar0.Value = Mathf.Clamp(Player.DashPoints - 0f, 0f, 1f);
|
|
||||||
|
|
||||||
EnergyBar1.MinValue = 0f;
|
|
||||||
EnergyBar1.MaxValue = 1f;
|
|
||||||
EnergyBar1.Value = Mathf.Clamp(Player.DashPoints - 1f, 0f, 1f);
|
|
||||||
|
|
||||||
EnergyBar2.MinValue = 0f;
|
|
||||||
EnergyBar2.MaxValue = 1f;
|
|
||||||
EnergyBar2.Value = Mathf.Clamp(Player.DashPoints - 2f, 0f, 1f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
[gd_scene format=3 uid="uid://llohfwmma2hv"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dsbiwhvdat5ul" path="res://src/player/ui/PlayerHud.cs" id="1_580w7"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://b7xxxshusx3sm" path="res://src/player/ui/player_hud.png" id="2_580w7"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://c0kdbshy1ipbe" path="res://src/player/ui/hp_bar.png" id="3_uku0i"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dwiu5ej85fc3i" path="res://src/player/ui/energy_bar.png" id="4_uku0i"]
|
|
||||||
|
|
||||||
[node name="PlayerHud" type="Control" unique_id=763981532]
|
|
||||||
layout_mode = 3
|
|
||||||
anchors_preset = 0
|
|
||||||
offset_right = 40.0
|
|
||||||
offset_bottom = 40.0
|
|
||||||
script = ExtResource("1_580w7")
|
|
||||||
|
|
||||||
[node name="PlayerHudBase" type="TextureRect" parent="." unique_id=400555418]
|
|
||||||
layout_mode = 0
|
|
||||||
offset_right = 64.0
|
|
||||||
offset_bottom = 24.0
|
|
||||||
texture = ExtResource("2_580w7")
|
|
||||||
|
|
||||||
[node name="HpBar" type="TextureProgressBar" parent="." unique_id=1950685336]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 0
|
|
||||||
offset_left = 8.0
|
|
||||||
offset_top = 6.0
|
|
||||||
offset_right = 60.0
|
|
||||||
offset_bottom = 46.0
|
|
||||||
value = 100.0
|
|
||||||
texture_progress = ExtResource("3_uku0i")
|
|
||||||
|
|
||||||
[node name="Control" type="Control" parent="." unique_id=302593641]
|
|
||||||
anchors_preset = 0
|
|
||||||
offset_left = 8.0
|
|
||||||
offset_top = 20.0
|
|
||||||
offset_right = 48.0
|
|
||||||
offset_bottom = 60.0
|
|
||||||
|
|
||||||
[node name="EnergyBar0" type="TextureProgressBar" parent="Control" unique_id=2122373484]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 0
|
|
||||||
offset_right = 40.0
|
|
||||||
offset_bottom = 40.0
|
|
||||||
max_value = 1.0
|
|
||||||
step = 0.1
|
|
||||||
value = 1.0
|
|
||||||
texture_progress = ExtResource("4_uku0i")
|
|
||||||
|
|
||||||
[node name="EnergyBar1" type="TextureProgressBar" parent="Control" unique_id=177919498]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 0
|
|
||||||
offset_left = 11.0
|
|
||||||
offset_right = 51.0
|
|
||||||
offset_bottom = 40.0
|
|
||||||
max_value = 1.0
|
|
||||||
step = 0.1
|
|
||||||
value = 1.0
|
|
||||||
texture_progress = ExtResource("4_uku0i")
|
|
||||||
|
|
||||||
[node name="EnergyBar2" type="TextureProgressBar" parent="Control" unique_id=1462542424]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 0
|
|
||||||
offset_left = 22.0
|
|
||||||
offset_right = 62.0
|
|
||||||
offset_bottom = 40.0
|
|
||||||
max_value = 1.0
|
|
||||||
step = 0.1
|
|
||||||
value = 0.5
|
|
||||||
texture_progress = ExtResource("4_uku0i")
|
|
||||||
10
src/shaders/vertex_fun.gdshaderinc
Normal file
10
src/shaders/vertex_fun.gdshaderinc
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include "res://src/shaders/noise3D.gdshaderinc"
|
||||||
|
|
||||||
|
vec2 wobble(vec2 p, float f, float a) {
|
||||||
|
float t = TIME * f;
|
||||||
|
vec2 offset = vec2(
|
||||||
|
snoise(vec3(p / 64.0, t)),
|
||||||
|
snoise(vec3(p / 64.0, -t))
|
||||||
|
);
|
||||||
|
return a * offset;
|
||||||
|
}
|
||||||
1
src/shaders/vertex_fun.gdshaderinc.uid
Normal file
1
src/shaders/vertex_fun.gdshaderinc.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://ds2bgpheg6yfy
|
||||||
31
src/ui/PlayerHud.cs
Normal file
31
src/ui/PlayerHud.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Dancer;
|
||||||
|
|
||||||
|
[Meta(typeof(IAutoNode))]
|
||||||
|
public partial class PlayerHud : Control
|
||||||
|
{
|
||||||
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
|
[Export] private Player Player { get; set; } = null!;
|
||||||
|
|
||||||
|
[Node] private Polygon2D HpBar { get; set; } = null!;
|
||||||
|
[Node] private Polygon2D EnergyBar0 { get; set; } = null!;
|
||||||
|
[Node] private Polygon2D EnergyBar1 { get; set; } = null!;
|
||||||
|
|
||||||
|
public void OnReady() => SetProcess(true);
|
||||||
|
|
||||||
|
public void OnProcess(double delta)
|
||||||
|
{
|
||||||
|
((ShaderMaterial)HpBar.Material).SetShaderParameter("ratios",
|
||||||
|
stackalloc float[] { 0f, 0f, Player.Health / Player.MaxHealth, 0f });
|
||||||
|
|
||||||
|
var energy0Fill = Mathf.Clamp(Player.DashPoints - 0f, 0f, 1f);
|
||||||
|
((ShaderMaterial)EnergyBar0.Material).SetShaderParameter("ratios",
|
||||||
|
stackalloc float[] { 0f, 0f, energy0Fill, 0f });
|
||||||
|
|
||||||
|
var energy1Fill = Mathf.Clamp(Player.DashPoints - 1f, 0f, 1f);
|
||||||
|
((ShaderMaterial)EnergyBar1.Material).SetShaderParameter("ratios",
|
||||||
|
stackalloc float[] { 0f, 0f, energy1Fill, 0f });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://dwiu5ej85fc3i"
|
uid="uid://dwiu5ej85fc3i"
|
||||||
path="res://.godot/imported/energy_bar.png-5d692337a8d4fc75932e5331744e6f31.ctex"
|
path="res://.godot/imported/energy_bar.png-02c88baf398c7dd6c09b262e160b55f4.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://src/player/ui/energy_bar.png"
|
source_file="res://src/ui/energy_bar.png"
|
||||||
dest_files=["res://.godot/imported/energy_bar.png-5d692337a8d4fc75932e5331744e6f31.ctex"]
|
dest_files=["res://.godot/imported/energy_bar.png-02c88baf398c7dd6c09b262e160b55f4.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://c0kdbshy1ipbe"
|
uid="uid://c0kdbshy1ipbe"
|
||||||
path="res://.godot/imported/hp_bar.png-fce09f911d5101836dd4a642325ba1e7.ctex"
|
path="res://.godot/imported/hp_bar.png-dad149f5958edda274a5b787fdfb48fd.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://src/player/ui/hp_bar.png"
|
source_file="res://src/ui/hp_bar.png"
|
||||||
dest_files=["res://.godot/imported/hp_bar.png-fce09f911d5101836dd4a642325ba1e7.ctex"]
|
dest_files=["res://.godot/imported/hp_bar.png-dad149f5958edda274a5b787fdfb48fd.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://b7xxxshusx3sm"
|
uid="uid://b7xxxshusx3sm"
|
||||||
path="res://.godot/imported/player_hud.png-17c4147e4f4eb6f0681b63f601977a48.ctex"
|
path="res://.godot/imported/player_hud.png-9842985ced4432e20f5da32d9c77546a.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://src/player/ui/player_hud.png"
|
source_file="res://src/ui/player_hud.png"
|
||||||
dest_files=["res://.godot/imported/player_hud.png-17c4147e4f4eb6f0681b63f601977a48.ctex"]
|
dest_files=["res://.godot/imported/player_hud.png-9842985ced4432e20f5da32d9c77546a.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
73
src/ui/player_hud.tscn
Normal file
73
src/ui/player_hud.tscn
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
[gd_scene format=3 uid="uid://llohfwmma2hv"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dsbiwhvdat5ul" path="res://src/ui/PlayerHud.cs" id="1_580w7"]
|
||||||
|
[ext_resource type="Shader" uid="uid://b5o01h7x0g8e5" path="res://src/ui/wobbly.gdshader" id="2_580w7"]
|
||||||
|
[ext_resource type="Shader" uid="uid://ddhhiokx3ekiu" path="res://src/ui/poly_bar.gdshader" id="3_gukev"]
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_580w7"]
|
||||||
|
shader = ExtResource("2_580w7")
|
||||||
|
shader_parameter/frequency = 0.125
|
||||||
|
shader_parameter/amplitude = 1.83
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_uku0i"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
shader = ExtResource("3_gukev")
|
||||||
|
shader_parameter/ratios = PackedFloat32Array(0, 0, 0.765, 0)
|
||||||
|
shader_parameter/empty_color = Color(0.12955844, 0.12955847, 0.12955844, 1)
|
||||||
|
shader_parameter/colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 1, 0.15294118, 0.827451, 0.79607844, 1, 0, 0, 0, 1)
|
||||||
|
shader_parameter/frequency = 0.125
|
||||||
|
shader_parameter/amplitude = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_wcly6"]
|
||||||
|
size = Vector2(32, 32)
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_i7kvj"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
shader = ExtResource("3_gukev")
|
||||||
|
shader_parameter/ratios = PackedFloat32Array(0, 0, 0.765, 0)
|
||||||
|
shader_parameter/empty_color = Color(0.12955844, 0.12955847, 0.12955844, 1)
|
||||||
|
shader_parameter/colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 1, 1, 0.43137255, 0.6862745, 1, 0, 0, 0, 1)
|
||||||
|
shader_parameter/frequency = 0.125
|
||||||
|
shader_parameter/amplitude = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_1dykc"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
shader = ExtResource("3_gukev")
|
||||||
|
shader_parameter/ratios = PackedFloat32Array(0, 0, 0.765, 0)
|
||||||
|
shader_parameter/empty_color = Color(0.12955844, 0.12955847, 0.12955844, 1)
|
||||||
|
shader_parameter/colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 1, 1, 0.43137255, 0.6862745, 1, 0, 0, 0, 1)
|
||||||
|
shader_parameter/frequency = 0.125
|
||||||
|
shader_parameter/amplitude = 1.0
|
||||||
|
|
||||||
|
[node name="PlayerHud" type="Control" unique_id=763981532]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 0
|
||||||
|
offset_right = 40.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
script = ExtResource("1_580w7")
|
||||||
|
|
||||||
|
[node name="Background" type="Polygon2D" parent="." unique_id=1500138878]
|
||||||
|
material = SubResource("ShaderMaterial_580w7")
|
||||||
|
color = Color(0, 0, 0, 1)
|
||||||
|
polygon = PackedVector2Array(3, 2, 2, 25, 32, 32, 55, 18, 92, 21, 110, -1)
|
||||||
|
|
||||||
|
[node name="HpBar" type="Polygon2D" parent="." unique_id=676108210]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
material = SubResource("ShaderMaterial_uku0i")
|
||||||
|
texture = SubResource("PlaceholderTexture2D_wcly6")
|
||||||
|
polygon = PackedVector2Array(8, 6, 99, 3, 88, 15, 8, 13)
|
||||||
|
uv = PackedVector2Array(0.18070698, 7.5369415, 31.720398, 1.6552172, 31.191221, 6.699565, 0.67256737, 9.95163)
|
||||||
|
|
||||||
|
[node name="EnergyBar0" type="Polygon2D" parent="." unique_id=800795938]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
material = SubResource("ShaderMaterial_i7kvj")
|
||||||
|
texture = SubResource("PlaceholderTexture2D_wcly6")
|
||||||
|
polygon = PackedVector2Array(8, 16, 24, 17, 19, 24, 6, 22)
|
||||||
|
uv = PackedVector2Array(-0.058876038, 12.0672, 31.749325, -0.97031116, 28.649677, 17.21373, 1.6946745, 25.515366)
|
||||||
|
|
||||||
|
[node name="EnergyBar1" type="Polygon2D" parent="." unique_id=2035511932]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
material = SubResource("ShaderMaterial_1dykc")
|
||||||
|
texture = SubResource("PlaceholderTexture2D_wcly6")
|
||||||
|
polygon = PackedVector2Array(28, 18, 45, 19, 34, 27, 22, 25)
|
||||||
|
uv = PackedVector2Array(1.3059769, 25.891489, 31.327286, -2.5226192, 27.199902, 30.23344, 3.7188683, 48.139774)
|
||||||
27
src/ui/poly_bar.gdshader
Normal file
27
src/ui/poly_bar.gdshader
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
shader_type canvas_item;
|
||||||
|
|
||||||
|
const int count = 4;
|
||||||
|
|
||||||
|
uniform float ratios[count];
|
||||||
|
uniform vec3 empty_color : source_color;
|
||||||
|
uniform vec3 colors[count] : source_color;
|
||||||
|
|
||||||
|
uniform float frequency = 1.0;
|
||||||
|
uniform float amplitude = 1.0;
|
||||||
|
|
||||||
|
#include "res://src/shaders/vertex_fun.gdshaderinc"
|
||||||
|
|
||||||
|
void vertex() {
|
||||||
|
VERTEX += wobble(VERTEX, frequency, amplitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
vec3 base_color = empty_color;
|
||||||
|
for (int idx = 0; idx < count; idx++) {
|
||||||
|
float ratio = ratios[idx];
|
||||||
|
vec3 fill_color = colors[idx];
|
||||||
|
if (ratio >= UV.x)
|
||||||
|
base_color = fill_color;
|
||||||
|
}
|
||||||
|
COLOR = vec4(base_color, 1.0);
|
||||||
|
}
|
||||||
1
src/ui/poly_bar.gdshader.uid
Normal file
1
src/ui/poly_bar.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://ddhhiokx3ekiu
|
||||||
10
src/ui/wobbly.gdshader
Normal file
10
src/ui/wobbly.gdshader
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
shader_type canvas_item;
|
||||||
|
|
||||||
|
uniform float frequency = 1.0;
|
||||||
|
uniform float amplitude = 1.0;
|
||||||
|
|
||||||
|
#include "res://src/shaders/vertex_fun.gdshaderinc"
|
||||||
|
|
||||||
|
void vertex() {
|
||||||
|
VERTEX += wobble(VERTEX, frequency, amplitude);
|
||||||
|
}
|
||||||
1
src/ui/wobbly.gdshader.uid
Normal file
1
src/ui/wobbly.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://b5o01h7x0g8e5
|
||||||
Loading…
Add table
Add a link
Reference in a new issue