From 516d22c1737a9c94026b5ff0c9856bc5549aa416 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 3 May 2024 09:32:22 +0200 Subject: update --- Scenes/Entities/Objects/Button.tscn | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Scenes/Entities/Objects/Button.tscn (limited to 'Scenes/Entities/Objects/Button.tscn') diff --git a/Scenes/Entities/Objects/Button.tscn b/Scenes/Entities/Objects/Button.tscn new file mode 100644 index 0000000..0416167 --- /dev/null +++ b/Scenes/Entities/Objects/Button.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=7 format=3 uid="uid://8fbkdifli6ic"] + +[ext_resource type="Script" path="res://Scenes/Entities/Objects/Button.gd" id="1_83jjd"] +[ext_resource type="Texture2D" uid="uid://b6ce2eihxulqb" path="res://Assets/Stages/core_set pieces.png" id="2_frejs"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_xgggr"] +size = Vector2(12, 7) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t47kb"] +atlas = ExtResource("2_frejs") +region = Rect2(272, 512, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6om1g"] +atlas = ExtResource("2_frejs") +region = Rect2(288, 512, 16, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_moi56"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_t47kb") +}], +"loop": false, +"name": &"default", +"speed": 1.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_6om1g") +}], +"loop": false, +"name": &"pressed", +"speed": 1.0 +}] + +[node name="Button" type="Area2D"] +z_index = -1 +collision_layer = 64 +collision_mask = 2 +script = ExtResource("1_83jjd") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, 1.5) +shape = SubResource("RectangleShape2D_xgggr") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_moi56") + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] -- cgit v1.2.3