oh-my-git/scenes/drop_area.tscn

50 lines
1.4 KiB
Text
Raw Normal View History

2020-11-10 12:14:45 +01:00
[gd_scene load_steps=6 format=2]
[ext_resource path="res://scenes/drop_area.gd" type="Script" id=1]
[ext_resource path="res://nodes/blob.svg" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
2020-11-10 12:42:47 +01:00
radius = 63.1532
2020-11-10 12:14:45 +01:00
[sub_resource type="Shader" id=2]
code = "shader_type canvas_item;
2020-11-10 12:42:47 +01:00
uniform float hovered;
2020-11-10 12:14:45 +01:00
void fragment() {
vec2 center = vec2(0.5, 0.5);
float d = distance(UV, center);
2020-11-10 12:42:47 +01:00
COLOR = vec4(0.4 + hovered*0.2, 0.65 + hovered*0.2, 1, smoothstep(0.5,0.2 + hovered*0.1,d));
2020-11-10 12:14:45 +01:00
}
"
[sub_resource type="ShaderMaterial" id=3]
2020-11-10 12:42:47 +01:00
resource_local_to_scene = true
2020-11-10 12:14:45 +01:00
shader = SubResource( 2 )
2020-11-10 12:42:47 +01:00
shader_param/hovered = 0.0
2020-11-10 12:14:45 +01:00
[node name="DropArea" type="Node2D" groups=[
"drop_areas",
]]
position = Vector2( -0.197731, 0.0673599 )
script = ExtResource( 1 )
[node name="Area2D" type="Area2D" parent="."]
input_pickable = false
collision_layer = 0
collision_mask = 524288
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource( 1 )
[node name="Highlight" type="Node2D" parent="."]
[node name="Sprite" type="Sprite" parent="Highlight"]
2020-11-10 12:14:45 +01:00
modulate = Color( 1, 1, 1, 0.643137 )
material = SubResource( 3 )
position = Vector2( -0.102825, -0.377726 )
scale = Vector2( 2.25501, 2.25501 )
texture = ExtResource( 2 )
[connection signal="area_entered" from="Area2D" to="." method="_mouse_entered"]
[connection signal="area_exited" from="Area2D" to="." method="_mouse_exited"]