|
- [gd_scene load_steps=5 format=2]
-
- [ext_resource path="res://Data/Graphics/placeholder.png" type="Texture" id=1]
- [ext_resource path="res://Data/Scripts/Glowdot.gd" type="Script" id=2]
-
- [sub_resource type="Shader" id=2]
- code = "shader_type canvas_item;
-
- uniform vec4 primary_color:hint_color = vec4(1.0, 0.8, 0.0, 1.0);
- uniform float fade_offset:hint_range(0.0, 0.5) = 0.1;
-
- float ramp(float v, float f_min, float f_max){
- float res = (v - f_min) / (f_max - f_min);
- return max(0.0, min(res, 1.0));
- }
-
- void fragment(){
- float mask = length(vec2(0.5, 0.5) - (UV.xy));
- float fade = 1.0 - ramp(mask, fade_offset, 0.5);
- if (mask > 0.5){
- mask = 0.0;
- } else {mask = 1.0;}
-
- if (mask == 1.0){
- COLOR = vec4(primary_color.rgb, fade);
- } else {
- COLOR = vec4(primary_color.rgb, mask);
- }
- }"
-
- [sub_resource type="ShaderMaterial" id=1]
- resource_local_to_scene = true
- shader = SubResource( 2 )
- shader_param/primary_color = Color( 0, 0, 0, 1 )
- shader_param/fade_offset = 0.14
-
- [node name="Glowdot" type="Sprite"]
- material = SubResource( 1 )
- texture = ExtResource( 1 )
- script = ExtResource( 2 )
- pulse_offset = 0.1
-
- [node name="Pulse" type="Tween" parent="."]
-
- [node name="PulseIn" type="Timer" parent="."]
-
- [node name="PulseOut" type="Timer" parent="."]
- [connection signal="timeout" from="PulseIn" to="." method="_on_PulseIn_timeout"]
- [connection signal="timeout" from="PulseOut" to="." method="_on_PulseOut_timeout"]
|