summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorrom <romangraef@gmail.com>2021-04-24 21:12:07 +0200
committerrom <romangraef@gmail.com>2021-04-24 21:12:18 +0200
commite7aad173ab49d57213df245bb6788baad6b07760 (patch)
tree76f6c475fb5e5645f1646c670ac9bc4c1f6b6db3 /components
parent97a8e53812afe9cd9e19311695a806dbdb8e2b90 (diff)
downloadldjam48-e7aad173ab49d57213df245bb6788baad6b07760.tar.gz
ldjam48-e7aad173ab49d57213df245bb6788baad6b07760.tar.bz2
ldjam48-e7aad173ab49d57213df245bb6788baad6b07760.zip
custom shader
Diffstat (limited to 'components')
-rw-r--r--components/HackButton.tscn16
1 files changed, 15 insertions, 1 deletions
diff --git a/components/HackButton.tscn b/components/HackButton.tscn
index afafb61..e3f61bb 100644
--- a/components/HackButton.tscn
+++ b/components/HackButton.tscn
@@ -1,8 +1,21 @@
-[gd_scene load_steps=4 format=2]
+[gd_scene load_steps=6 format=2]
[ext_resource path="res://textures/rooot.png" type="Texture" id=1]
[ext_resource path="res://components/HackButton.gd" type="Script" id=2]
+[sub_resource type="Shader" id=2]
+code = "shader_type canvas_item;
+uniform vec4 glow_color : hint_color = vec4(1,1,1,1);
+
+void fragment() {
+ COLOR = texture(TEXTURE, UV) + glow_color;
+}
+"
+
+[sub_resource type="ShaderMaterial" id=3]
+shader = SubResource( 2 )
+shader_param/glow_color = Color( 0.254902, 0, 0, 1 )
+
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 100, 100 )
@@ -12,6 +25,7 @@ monitorable = false
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
+material = SubResource( 3 )
scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 1 )