forked from moonbench/simple-godot-train
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrackSwitch.tscn
114 lines (90 loc) · 5.18 KB
/
TrackSwitch.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[gd_scene load_steps=9 format=3 uid="uid://jvakchg2s8i4"]
[ext_resource type="Script" path="res://Scripts/TrackSwitch.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://isd3o7ji1m5j" path="res://Scenes/Track.tscn" id="2"]
[ext_resource type="Texture2D" uid="uid://cjm22oirs0or4" path="res://Demo/Assets/arrow.png" id="3"]
[ext_resource type="Texture2D" uid="uid://cy6vudnfoiv4o" path="res://Demo/Assets/switch_right.png" id="4"]
[ext_resource type="Texture2D" uid="uid://cbhnr32w8moim" path="res://Demo/Assets/switch_left.png" id="5"]
[sub_resource type="Curve2D" id="3"]
resource_local_to_scene = true
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, -24.0172, 16.0049, 24.0172, -16.0049, 64, -16, 0, 0, 0, 0, 128, -32)
}
point_count = 3
[sub_resource type="Curve2D" id="4"]
resource_local_to_scene = true
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, -23.902, -16.0644, 23.902, 16.0644, 64, 16, 0, 0, 0, 0, 128, 32)
}
point_count = 3
[sub_resource type="Theme" id="10"]
CheckButton/icons/checked = ExtResource("4")
CheckButton/icons/unchecked = ExtResource("5")
[node name="TrackSwitch" type="Node2D"]
script = ExtResource("1")
[node name="LeftTrack" parent="." instance=ExtResource("2")]
curve = SubResource("3")
[node name="HeadPoint" parent="LeftTrack" index="0"]
rotation = -0.244979
[node name="TrackJunction" parent="LeftTrack/HeadPoint" index="0"]
parent = NodePath("../../..")
[node name="TailPoint" parent="LeftTrack" index="1"]
position = Vector2(128, -32)
rotation = -0.244979
progress = 133.506
[node name="TrackJunction" parent="LeftTrack/TailPoint" index="0"]
parent = NodePath("../../..")
side = "left"
[node name="TrackVisualComponent" parent="LeftTrack" index="2"]
points = PackedVector2Array(0, 0, 1.76492, -0.031049, 6.62258, -0.249311, 10.0063, -0.487294, 13.9173, -0.842458, 18.2737, -1.33826, 22.9935, -1.99816, 25.4641, -2.39698, 27.9948, -2.84562, 30.5754, -3.34702, 33.1956, -3.9041, 35.8451, -4.5198, 38.5139, -5.19705, 41.1915, -5.93878, 43.8677, -6.74793, 46.5324, -7.62743, 49.1753, -8.58021, 51.786, -9.6092, 54.3544, -10.7173, 56.8703, -11.9076, 59.3233, -13.1828, 61.7033, -14.546, 64, -16, 66.2967, -17.454, 68.6767, -18.8172, 71.1297, -20.0924, 73.6456, -21.2827, 76.214, -22.3908, 78.8247, -23.4198, 81.4676, -24.3726, 84.1323, -25.2521, 86.8085, -26.0612, 89.4861, -26.803, 92.1549, -27.4802, 94.8044, -28.0959, 97.4246, -28.653, 100.005, -29.1544, 102.536, -29.603, 105.006, -30.0018, 109.726, -30.6617, 114.083, -31.1575, 117.994, -31.5127, 121.377, -31.7507, 126.235, -31.969, 128, -32)
[node name="Pointer" type="PathFollow2D" parent="LeftTrack"]
visible = false
z_index = 2
position = Vector2(64, -16)
rotation = -0.587812
progress = 66.7531
[node name="Sprite2D" type="Sprite2D" parent="LeftTrack/Pointer"]
texture = ExtResource("3")
[node name="RightTrack" parent="." instance=ExtResource("2")]
z_index = 1
curve = SubResource("4")
[node name="HeadPoint" parent="RightTrack" index="0"]
rotation = 0.244979
[node name="TrackJunction" parent="RightTrack/HeadPoint" index="0"]
parent = NodePath("../../..")
enabled = false
[node name="TailPoint" parent="RightTrack" index="1"]
position = Vector2(128, 32)
rotation = 0.244979
progress = 133.535
[node name="TrackJunction" parent="RightTrack/TailPoint" index="0"]
parent = NodePath("../../..")
side = "right"
[node name="TrackVisualComponent" parent="RightTrack" index="2"]
points = PackedVector2Array(0, 0, 1.76964, 0.0286086, 6.63878, 0.240944, 10.0295, 0.47531, 13.9477, 0.82677, 18.3109, 1.31904, 23.0368, 1.97585, 25.5098, 2.37337, 28.0427, 2.82091, 30.6249, 3.32145, 33.2462, 3.87795, 35.8963, 4.49337, 38.5649, 5.17068, 41.2417, 5.91285, 43.9163, 6.72283, 46.5786, 7.6036, 49.218, 8.55812, 51.8245, 9.58935, 54.3875, 10.7003, 56.8969, 11.8938, 59.3423, 13.173, 61.7135, 14.5407, 64, 16, 66.2865, 17.4593, 68.6577, 18.827, 71.1031, 20.1062, 73.6125, 21.2997, 76.1756, 22.4107, 78.782, 23.4419, 81.4214, 24.3964, 84.0837, 25.2772, 86.7583, 26.0872, 89.4351, 26.8293, 92.1037, 27.5066, 94.7538, 28.1221, 97.3751, 28.6785, 99.9574, 29.1791, 102.49, 29.6266, 104.963, 30.0242, 109.689, 30.681, 114.052, 31.1732, 117.97, 31.5247, 121.361, 31.7591, 126.23, 31.9714, 128, 32)
[node name="Pointer" type="PathFollow2D" parent="RightTrack"]
z_index = 2
position = Vector2(64, 16)
rotation = 0.59175
progress = 66.7674
[node name="Sprite2D" type="Sprite2D" parent="RightTrack/Pointer"]
texture = ExtResource("3")
[node name="Button" type="CheckButton" parent="."]
custom_minimum_size = Vector2(0, 92)
offset_left = -64.0
offset_top = -80.0
offset_right = 12.0
offset_bottom = 12.0
rotation = 1.5708
pivot_offset = Vector2(64, 46)
focus_mode = 0
theme = SubResource("10")
button_pressed = true
keep_pressed_outside = true
shortcut_in_tooltip = false
[connection signal="bogie_at_head" from="LeftTrack" to="." method="_on_left_track_bogie_at_head"]
[connection signal="bogie_at_tail" from="LeftTrack" to="." method="_on_left_track_bogie_at_tail"]
[connection signal="bogie_at_head" from="RightTrack" to="." method="_on_right_track_bogie_at_head"]
[connection signal="bogie_at_tail" from="RightTrack" to="." method="_on_right_track_bogie_at_tail"]
[connection signal="pressed" from="Button" to="." method="switch"]
[editable path="LeftTrack"]
[editable path="RightTrack"]