summaryrefslogtreecommitdiff
path: root/demos/2d/area_input/input.tscn
blob: 81c0ed918d525320e8780cf47f3ee89400e63a96 (plain)
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
[gd_scene load_steps=6 format=1]

[ext_resource path="res://input.gd" type="Script" id=1]
[ext_resource path="res://box_area.png" type="Texture" id=2]
[ext_resource path="res://circle_area.png" type="Texture" id=3]

[sub_resource type="RectangleShape2D" id=1]

custom_solver_bias = 0.0
extents = Vector2( 64, 64 )

[sub_resource type="CircleShape2D" id=2]

custom_solver_bias = 0.0
radius = 64.0

[node name="base" type="Node2D"]

[node name="box" type="Area2D" parent="."]

transform/pos = Vector2( 212, 281 )
transform/rot = 35.4081
input/pickable = true
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
script/script = ExtResource( 1 )

[node name="sprite" type="Sprite" parent="box"]

texture = ExtResource( 2 )

[node name="label" type="Label" parent="box"]

focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = -43.0
margin/top = 71.0
margin/right = 43.0
margin/bottom = 84.0
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

[node name="shape" type="CollisionShape2D" parent="box"]

shape = SubResource( 1 )
trigger = false
_update_shape_index = -1

[node name="circle" type="Area2D" parent="."]

transform/pos = Vector2( 547.877, 286.808 )
transform/rot = -40.5985
input/pickable = true
shapes/0/shape = SubResource( 2 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
script/script = ExtResource( 1 )

[node name="sprite" type="Sprite" parent="circle"]

texture = ExtResource( 3 )

[node name="label" type="Label" parent="circle"]

focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = -43.0
margin/top = 71.0
margin/right = 43.0
margin/bottom = 84.0
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

[node name="shape" type="CollisionShape2D" parent="circle"]

shape = SubResource( 2 )
trigger = false
_update_shape_index = -1

[node name="Label" type="Label" parent="."]

focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 40.0
margin/bottom = 13.0
text = "This demo shows how to use a regular Area2D to get input events, and how to convert the input events to local coordinates of the node.\nUnlike controls, Input on Area2D or PhysicsBody2D nodes only works properly (with scrolling) on canvas layer 0."
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1