-
Notifications
You must be signed in to change notification settings - Fork 0
/
joystick_demo.tscn
63 lines (50 loc) · 2.02 KB
/
joystick_demo.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
[gd_scene load_steps=4 format=3 uid="uid://dx3bmigtw3uxs"]
[ext_resource type="PackedScene" uid="uid://dyissvogocr44" path="res://addons/joystick/joystick.tscn" id="1_1dbvj"]
[ext_resource type="Script" path="res://CharacterBody2D.gd" id="2_yiaqr"]
[ext_resource type="Texture2D" uid="uid://cl6c44qas3mpa" path="res://icon.svg" id="3_qh0f4"]
[node name="Node2D" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Icon" type="Sprite2D" parent="."]
position = Vector2(562.5, 293.5)
scale = Vector2(9.92969, 6.16406)
texture = ExtResource("3_qh0f4")
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
position = Vector2(573, 282)
script = ExtResource("2_yiaqr")
[node name="Icon2" type="Sprite2D" parent="CharacterBody2D"]
position = Vector2(0, -70)
scale = Vector2(0.159995, 1)
texture = ExtResource("3_qh0f4")
[node name="Icon" type="Sprite2D" parent="CharacterBody2D/Icon2"]
position = Vector2(0, 70)
scale = Vector2(6.25019, 1)
texture = ExtResource("3_qh0f4")
[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"]
position_smoothing_enabled = true
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Left" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
grow_vertical = 0
[node name="Joystick" parent="CanvasLayer/Left" instance=ExtResource("1_1dbvj")]
position = Vector2(20, -220)
[node name="Right" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 0
grow_vertical = 0
[node name="Joystick2" parent="CanvasLayer/Right" instance=ExtResource("1_1dbvj")]
position = Vector2(-220, -220)
[connection signal="joystick_input" from="CanvasLayer/Left/Joystick" to="CharacterBody2D" method="_on_joystick_joystick_input"]
[connection signal="joystick_input" from="CanvasLayer/Right/Joystick2" to="CharacterBody2D" method="_on_joystick_2_joystick_input"]