Skip to content

Commit 5de16ac

Browse files
committed
Full touchscreen support
1 parent a1eac01 commit 5de16ac

File tree

11 files changed

+210
-174
lines changed

11 files changed

+210
-174
lines changed

CREDITS.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ The above copyright notice and this permission notice shall be included in all c
1010
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1111

1212
# [FreeType](https://www.freetype.org)
13-
Portions of this software are copyright © 2019 The FreeType
14-
Project (www.freetype.org). All rights reserved.
13+
Portions of this software are copyright © 2019 The FreeType Project (www.freetype.org). All rights reserved.
14+
15+
# [Hack](https://github.com/source-foundry/Hack)
16+
17+
The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License

assets/theme.theme

6 Bytes
Binary file not shown.

levels/comparison_sort.gd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ func _input(event):
3333
if event is InputEventKey and event.is_pressed():
3434
return next(event.as_text())
3535
if event is InputEventMouseButton and event.is_pressed():
36-
print(event.position)
37-
print(get_viewport().size)
3836
if event.position.x < ProjectSettings.get_setting("display/window/size/width") / 2:
3937
return next("Left")
4038
else:

project.godot

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -173,41 +173,6 @@ ui_down={
173173
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
174174
]
175175
}
176-
faster={
177-
"deadzone": 0.5,
178-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
179-
]
180-
}
181-
slower={
182-
"deadzone": 0.5,
183-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
184-
]
185-
}
186-
bigger={
187-
"deadzone": 0.5,
188-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
189-
]
190-
}
191-
smaller={
192-
"deadzone": 0.5,
193-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
194-
]
195-
}
196-
toggle_sound={
197-
"deadzone": 0.5,
198-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":77,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
199-
]
200-
}
201-
change_data={
202-
"deadzone": 0.5,
203-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":67,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
204-
]
205-
}
206-
big_preview={
207-
"deadzone": 0.5,
208-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":66,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
209-
]
210-
}
211176

212177
[rendering]
213178

scenes/credits.tscn

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
[gd_scene load_steps=3 format=2]
1+
[gd_scene load_steps=4 format=2]
22

33
[ext_resource path="res://assets/theme.theme" type="Theme" id=1]
44
[ext_resource path="res://scripts/credits.gd" type="Script" id=2]
5+
[ext_resource path="res://scripts/border.gd" type="Script" id=3]
56

67
[node name="MarginContainer" type="MarginContainer"]
78
anchor_right = 1.0
@@ -11,15 +12,19 @@ custom_constants/margin_right = 40
1112
custom_constants/margin_top = 30
1213
custom_constants/margin_left = 40
1314
custom_constants/margin_bottom = 30
14-
__meta__ = {
15-
"_edit_use_anchors_": false
16-
}
1715

18-
[node name="Credits" type="Label" parent="."]
16+
[node name="MarginContainer" type="MarginContainer" parent="."]
1917
margin_left = 40.0
2018
margin_top = 30.0
21-
margin_right = 1880.0
22-
margin_bottom = 1050.0
19+
margin_right = 1240.0
20+
margin_bottom = 690.0
21+
script = ExtResource( 3 )
22+
23+
[node name="Credits" type="Label" parent="MarginContainer"]
24+
margin_left = 20.0
25+
margin_top = 20.0
26+
margin_right = 1180.0
27+
margin_bottom = 640.0
2328
size_flags_vertical = 3
2429
autowrap = true
2530
script = ExtResource( 2 )

scenes/levels.tscn

Lines changed: 108 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,43 @@ margin_top = 20.0
2727
margin_right = 1220.0
2828
margin_bottom = 39.0
2929

30+
[node name="Back" type="Button" parent="Levels/NamesContainer/Names"]
31+
margin_right = 170.0
32+
margin_bottom = 19.0
33+
text = "BACK TO MAIN MENU"
34+
3035
[node name="Previous" type="Button" parent="Levels/NamesContainer/Names"]
31-
margin_right = 557.0
36+
margin_left = 178.0
37+
margin_right = 562.0
3238
margin_bottom = 19.0
3339
size_flags_horizontal = 3
3440
text = "<--"
35-
align = 0
41+
align = 2
3642

3743
[node name="Current" type="Button" parent="Levels/NamesContainer/Names"]
38-
margin_left = 565.0
39-
margin_right = 635.0
44+
margin_left = 570.0
45+
margin_right = 640.0
4046
margin_bottom = 19.0
4147
focus_neighbour_left = NodePath(".")
48+
focus_neighbour_top = NodePath("../BigPicture")
4249
focus_neighbour_right = NodePath(".")
4350
text = "CURRENT"
4451

4552
[node name="Next" type="Button" parent="Levels/NamesContainer/Names"]
46-
margin_left = 643.0
47-
margin_right = 1200.0
53+
margin_left = 648.0
54+
margin_right = 1032.0
4855
margin_bottom = 19.0
4956
size_flags_horizontal = 3
5057
text = "-->"
51-
align = 2
58+
align = 0
59+
60+
[node name="BigPicture" type="Button" parent="Levels/NamesContainer/Names"]
61+
margin_left = 1040.0
62+
margin_right = 1200.0
63+
margin_bottom = 19.0
64+
focus_neighbour_top = NodePath("../../../Level/Right/Info/ScoresContainer/Scores/Controls/Faster")
65+
focus_neighbour_bottom = NodePath("../Current")
66+
text = "BIG PICTURE MODE"
5267

5368
[node name="Level" type="HBoxContainer" parent="Levels"]
5469
margin_top = 67.0
@@ -84,16 +99,16 @@ size_flags_horizontal = 3
8499

85100
[node name="Display" type="MarginContainer" parent="Levels/Level/Right"]
86101
margin_right = 616.0
87-
margin_bottom = 475.0
102+
margin_bottom = 477.0
88103
size_flags_vertical = 3
89104
script = ExtResource( 3 )
90105

91106
[node name="TypesContainer" type="MarginContainer" parent="Levels/Level/Right/Display"]
92107
visible = false
93108
margin_left = 288.0
94-
margin_top = 217.0
109+
margin_top = 218.0
95110
margin_right = 328.0
96-
margin_bottom = 257.0
111+
margin_bottom = 258.0
97112
size_flags_horizontal = 4
98113
size_flags_vertical = 4
99114
script = ExtResource( 3 )
@@ -102,16 +117,16 @@ script = ExtResource( 3 )
102117
margin_left = 20.0
103118
margin_top = 20.0
104119
margin_right = 596.0
105-
margin_bottom = 455.0
120+
margin_bottom = 457.0
106121

107122
[node name="Info" type="HBoxContainer" parent="Levels/Level/Right"]
108-
margin_top = 483.0
123+
margin_top = 485.0
109124
margin_right = 616.0
110125
margin_bottom = 613.0
111126

112127
[node name="ControlsContainer" type="MarginContainer" parent="Levels/Level/Right/Info"]
113128
margin_right = 405.0
114-
margin_bottom = 130.0
129+
margin_bottom = 128.0
115130
size_flags_horizontal = 3
116131
size_flags_stretch_ratio = 2.0
117132
script = ExtResource( 3 )
@@ -120,64 +135,113 @@ script = ExtResource( 3 )
120135
margin_left = 20.0
121136
margin_top = 20.0
122137
margin_right = 385.0
123-
margin_bottom = 110.0
138+
margin_bottom = 108.0
124139
size_flags_vertical = 1
125140
text = "These are the controls for the level."
126141
autowrap = true
127142

128143
[node name="ScoresContainer" type="MarginContainer" parent="Levels/Level/Right/Info"]
129144
margin_left = 413.0
130145
margin_right = 616.0
131-
margin_bottom = 130.0
146+
margin_bottom = 128.0
132147
size_flags_horizontal = 3
133148
script = ExtResource( 3 )
134149

135150
[node name="Scores" type="VBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer"]
136151
margin_left = 20.0
137152
margin_top = 20.0
138153
margin_right = 183.0
139-
margin_bottom = 110.0
154+
margin_bottom = 108.0
155+
custom_constants/separation = 4
140156

141-
[node name="Header" type="HBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer/Scores"]
157+
[node name="Easy" type="HBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer/Scores"]
142158
margin_right = 163.0
143159
margin_bottom = 19.0
144160

145-
[node name="Size" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Header"]
146-
margin_right = 40.0
161+
[node name="Button" type="Button" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Easy"]
162+
margin_right = 125.0
147163
margin_bottom = 19.0
148-
text = "SIZE"
164+
size_flags_horizontal = 3
165+
text = "EASY"
166+
align = 0
149167

150-
[node name="Time" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Header"]
151-
margin_left = 48.0
168+
[node name="Time" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Easy"]
169+
margin_left = 133.0
152170
margin_right = 163.0
153171
margin_bottom = 19.0
154-
size_flags_horizontal = 3
155-
text = "HIGH SCORE"
172+
text = "INF"
156173
align = 2
174+
uppercase = true
157175

158-
[node name="Data" type="HBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer/Scores"]
159-
margin_top = 27.0
176+
[node name="Medium" type="HBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer/Scores"]
177+
margin_top = 23.0
160178
margin_right = 163.0
161-
margin_bottom = 90.0
179+
margin_bottom = 42.0
162180

163-
[node name="Sizes" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Data"]
164-
margin_right = 20.0
165-
margin_bottom = 63.0
166-
text = "16
167-
32
168-
64"
181+
[node name="Button" type="Button" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Medium"]
182+
margin_right = 125.0
183+
margin_bottom = 19.0
184+
size_flags_horizontal = 3
185+
text = "MEDIUM"
186+
align = 0
187+
188+
[node name="Time" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Medium"]
189+
margin_left = 133.0
190+
margin_right = 163.0
191+
margin_bottom = 19.0
192+
text = "INF"
193+
align = 2
194+
uppercase = true
169195

170-
[node name="Times" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Data"]
171-
margin_left = 28.0
196+
[node name="Hard" type="HBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer/Scores"]
197+
margin_top = 46.0
172198
margin_right = 163.0
173-
margin_bottom = 63.0
199+
margin_bottom = 65.0
200+
201+
[node name="Button" type="Button" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Hard"]
202+
margin_right = 125.0
203+
margin_bottom = 19.0
174204
size_flags_horizontal = 3
175-
text = "INF
176-
INF
177-
INF"
205+
text = "HARD"
206+
align = 0
207+
208+
[node name="Time" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Hard"]
209+
margin_left = 133.0
210+
margin_right = 163.0
211+
margin_bottom = 19.0
212+
text = "INF"
178213
align = 2
179214
uppercase = true
180215

216+
[node name="Controls" type="HBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer/Scores"]
217+
margin_top = 69.0
218+
margin_right = 163.0
219+
margin_bottom = 88.0
220+
221+
[node name="Custom" type="Button" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Controls"]
222+
margin_right = 107.0
223+
margin_bottom = 19.0
224+
focus_neighbour_bottom = NodePath("../Slower")
225+
size_flags_horizontal = 3
226+
text = "CUSTOM..."
227+
align = 0
228+
229+
[node name="Slower" type="Button" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Controls"]
230+
margin_left = 115.0
231+
margin_right = 135.0
232+
margin_bottom = 19.0
233+
focus_neighbour_top = NodePath("../Custom")
234+
focus_neighbour_bottom = NodePath("../Faster")
235+
text = "<<"
236+
237+
[node name="Faster" type="Button" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Controls"]
238+
margin_left = 143.0
239+
margin_right = 163.0
240+
margin_bottom = 19.0
241+
focus_neighbour_top = NodePath("../Slower")
242+
focus_neighbour_bottom = NodePath("../../../../../../../NamesContainer/Names/BigPicture")
243+
text = ">>"
244+
181245
[node name="BigDisplay" type="MarginContainer" parent="Levels"]
182246
visible = false
183247
margin_top = 640.0
@@ -203,7 +267,12 @@ margin_bottom = 20.0
203267

204268
[node name="Timer" type="Timer" parent="Levels"]
205269

270+
[connection signal="pressed" from="Levels/NamesContainer/Names/Back" to="Levels" method="_on_Back_pressed"]
206271
[connection signal="pressed" from="Levels/NamesContainer/Names/Previous" to="Levels" method="_on_Previous_pressed"]
207272
[connection signal="pressed" from="Levels/NamesContainer/Names/Current" to="Levels" method="_on_Current_pressed"]
208273
[connection signal="pressed" from="Levels/NamesContainer/Names/Next" to="Levels" method="_on_Next_pressed"]
274+
[connection signal="pressed" from="Levels/NamesContainer/Names/BigPicture" to="Levels" method="_on_BigPicture_pressed"]
275+
[connection signal="pressed" from="Levels/Level/Right/Info/ScoresContainer/Scores/Controls/Custom" to="Levels" method="_on_Custom_pressed"]
276+
[connection signal="pressed" from="Levels/Level/Right/Info/ScoresContainer/Scores/Controls/Slower" to="Levels" method="_on_Slower_pressed"]
277+
[connection signal="pressed" from="Levels/Level/Right/Info/ScoresContainer/Scores/Controls/Faster" to="Levels" method="_on_Faster_pressed"]
209278
[connection signal="timeout" from="Levels/Timer" to="Levels" method="_on_Timer_timeout"]

0 commit comments

Comments
 (0)