summaryrefslogtreecommitdiff
path: root/demos/2d/area_input
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2016-04-02 12:35:23 +0200
committerRémi Verschelde <rverschelde@gmail.com>2016-04-02 14:39:08 +0200
commit23cf6a85bdb904a1833c6015222d9ee69842c1ed (patch)
treef363b1cf1b6c9deb0549b071514dfc1ee7d5f093 /demos/2d/area_input
parent4eb49cc73241e0597174c4bfdfdddaf96dce86af (diff)
Port 2D demos to TSCN/TRES formats
Part of #4196.
Diffstat (limited to 'demos/2d/area_input')
-rw-r--r--demos/2d/area_input/engine.cfg2
-rw-r--r--demos/2d/area_input/input.scnbin3118 -> 0 bytes
-rw-r--r--demos/2d/area_input/input.tscn109
3 files changed, 110 insertions, 1 deletions
diff --git a/demos/2d/area_input/engine.cfg b/demos/2d/area_input/engine.cfg
index 8fa2e15beb..ce87f39547 100644
--- a/demos/2d/area_input/engine.cfg
+++ b/demos/2d/area_input/engine.cfg
@@ -1,5 +1,5 @@
[application]
name="Area 2D Input Events"
-main_scene="res://input.scn"
+main_scene="res://input.tscn"
icon="res://icon.png"
diff --git a/demos/2d/area_input/input.scn b/demos/2d/area_input/input.scn
deleted file mode 100644
index f3a19f64da..0000000000
--- a/demos/2d/area_input/input.scn
+++ /dev/null
Binary files differ
diff --git a/demos/2d/area_input/input.tscn b/demos/2d/area_input/input.tscn
new file mode 100644
index 0000000000..81c0ed918d
--- /dev/null
+++ b/demos/2d/area_input/input.tscn
@@ -0,0 +1,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
+
+