[gd_scene load_steps=14 format=3 uid="uid://bq1y86drsbsgc"]

[ext_resource type="Script" path="res://guide_examples/tap_and_hold/tap_and_hold.gd" id="1_ek3h7"]
[ext_resource type="Texture2D" uid="uid://byjxtsekdl8t2" path="res://guide_examples/shared/godot_logo.svg" id="1_segxn"]
[ext_resource type="Script" path="res://guide_examples/tap_and_hold/player.gd" id="2_gpfh8"]
[ext_resource type="Resource" uid="uid://dkorp45s6fjqk" path="res://guide_examples/tap_and_hold/mapping_contexts/tap_and_hold.tres" id="3_u8e88"]
[ext_resource type="Resource" uid="uid://djow080f02fos" path="res://guide_examples/tap_and_hold/mapping_contexts/jump.tres" id="4_8qeav"]
[ext_resource type="Resource" uid="uid://dcdlaiw50k4t3" path="res://guide_examples/tap_and_hold/mapping_contexts/somersault.tres" id="5_wp1cr"]
[ext_resource type="Theme" uid="uid://dot0gi1yoqmrl" path="res://guide_examples/shared/ui_theme.tres" id="6_r6oud"]
[ext_resource type="PackedScene" uid="uid://dkr80d2pi0d41" path="res://addons/guide/debugger/guide_debugger.tscn" id="6_vjlt4"]
[ext_resource type="Script" path="res://guide_examples/shared/instructions_label.gd" id="7_304xo"]

[sub_resource type="Animation" id="Animation_j3lvc"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Player:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(546, 317)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Player:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}

[sub_resource type="Animation" id="Animation_a86xu"]
resource_name = "jump"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Player:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(546, 317), Vector2(546, 260), Vector2(546, 317)]
}

[sub_resource type="Animation" id="Animation_fir1a"]
resource_name = "somersault"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Player:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(546, 317), Vector2(546, 200), Vector2(546, 317)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Player:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.3, 0.5, 0.7),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [0.0, 0.0, -3.14159, -6.28319]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_8sm1c"]
_data = {
"RESET": SubResource("Animation_j3lvc"),
"jump": SubResource("Animation_a86xu"),
"somersault": SubResource("Animation_fir1a")
}

[node name="TapAndHold" type="Node"]
script = ExtResource("1_ek3h7")
mapping_context = ExtResource("3_u8e88")

[node name="Player" type="Sprite2D" parent="."]
position = Vector2(546, 317)
texture = ExtResource("1_segxn")
script = ExtResource("2_gpfh8")
jump_action = ExtResource("4_8qeav")
somersault_action = ExtResource("5_wp1cr")

[node name="ProgressBar" type="ProgressBar" parent="Player"]
unique_name_in_owner = true
visible = false
offset_left = -58.0
offset_top = 64.0
offset_right = 57.0
offset_bottom = 91.0
max_value = 1.0
show_percentage = false

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
"": SubResource("AnimationLibrary_8sm1c")
}

[node name="UI Layer" type="CanvasLayer" parent="."]

[node name="Instructions Label" type="RichTextLabel" parent="UI Layer"]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -473.0
offset_top = 527.0
offset_right = -226.0
offset_bottom = 550.0
grow_horizontal = 0
theme = ExtResource("6_r6oud")
script = ExtResource("7_304xo")
instructions_text = "Tap %s to jump.
Hold %s to somersault."
actions = Array[Resource("res://addons/guide/guide_action.gd")]([ExtResource("4_8qeav"), ExtResource("5_wp1cr")])
metadata/_edit_use_anchors_ = true

[node name="Label" type="Label" parent="UI Layer"]
visible = false
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -660.0
offset_top = 71.0
offset_right = -57.0
offset_bottom = 223.0
grow_horizontal = 0
theme = ExtResource("6_r6oud")
text = "This demonstrates using the hold and tap triggers to bind multiple actions to the same key.  This also uses the hold action's elapsed_ratio property to drive a hold progress bar to indicate how long the key needs to be held."
autowrap_mode = 2

[node name="Debug Layer" type="CanvasLayer" parent="."]
visible = false

[node name="GuideDebugger" parent="Debug Layer" instance=ExtResource("6_vjlt4")]
theme = ExtResource("6_r6oud")
metadata/_edit_lock_ = true
