Skip to content

Commit aca3ea4

Browse files
authored
Merge pull request #341 from Calinou/handle-multiple-resolutions
Handle multiple resolutions in most demos
2 parents eb81478 + a45b84a commit aca3ea4

File tree

249 files changed

+1488
-562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+1488
-562
lines changed

2d/finite_state_machine/Demo.tscn

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
[gd_scene load_steps=5 format=2]
22

3-
[ext_resource path="res://player/Player.tscn" type="PackedScene" id=1]
4-
[ext_resource path="res://debug/StatesStackDiplayer.tscn" type="PackedScene" id=2]
5-
[ext_resource path="res://debug/ControlsPanel.tscn" type="PackedScene" id=3]
6-
[ext_resource path="res://debug/Explanations.tscn" type="PackedScene" id=4]
3+
[ext_resource path="res://debug/ControlsPanel.tscn" type="PackedScene" id=1]
4+
[ext_resource path="res://debug/Explanations.tscn" type="PackedScene" id=2]
5+
[ext_resource path="res://debug/StatesStackDiplayer.tscn" type="PackedScene" id=3]
6+
[ext_resource path="res://player/Player.tscn" type="PackedScene" id=4]
77

88
[node name="Demo" type="Node"]
99

10-
[node name="Player" parent="." instance=ExtResource( 1 )]
11-
editor/display_folded = true
10+
[node name="Player" parent="." instance=ExtResource( 4 )]
1211

13-
[node name="StatesStackDiplayer" parent="." instance=ExtResource( 2 )]
12+
[node name="Explanations" parent="." instance=ExtResource( 2 )]
1413

15-
[node name="ControlsPanel" parent="." instance=ExtResource( 3 )]
14+
[node name="Control" type="Control" parent="."]
15+
anchor_right = 1.0
16+
anchor_bottom = 1.0
17+
__meta__ = {
18+
"_edit_use_anchors_": false
19+
}
1620

17-
[node name="Explanations" parent="." instance=ExtResource( 4 )]
21+
[node name="StatesStackDiplayer" parent="Control" instance=ExtResource( 3 )]
1822

23+
[node name="ControlsPanel" parent="Control" instance=ExtResource( 1 )]
1924

2025
[editable path="Player"]

2d/finite_state_machine/debug/ControlsPanel.tscn

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

3-
[ext_resource path="res://debug/top_level_ui.gd" type="Script" id=1]
43
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2]
54

65
[node name="ControlsPanel" type="Panel"]
76
anchor_left = 1.0
87
anchor_right = 1.0
98
margin_left = -220.0
109
margin_bottom = 170.0
11-
script = ExtResource( 1 )
10+
__meta__ = {
11+
"_edit_use_anchors_": false
12+
}
1213

1314
[node name="Keys" type="Label" parent="."]
1415
anchor_right = 1.0
@@ -38,4 +39,3 @@ X
3839
Space
3940
Shift"
4041
align = 2
41-

2d/finite_state_machine/debug/Explanations.tscn

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

33
[ext_resource path="res://fonts/source_code_pro_explanations_bold.tres" type="DynamicFont" id=1]
44
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2]
5-
[ext_resource path="res://debug/top_level_ui.gd" type="Script" id=3]
65

76
[node name="Explanations" type="RichTextLabel"]
87
anchor_right = 1.0
@@ -35,8 +34,6 @@ States are common in games. You can use the pattern to:
3534
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
3635
3736
You can read more about States in the excellent Game Programming Patterns ebook."
38-
script = ExtResource( 3 )
3937
__meta__ = {
4038
"_edit_lock_": true
4139
}
42-

2d/finite_state_machine/debug/StatesStackDiplayer.tscn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,3 @@ margin_bottom = 170.0
4646
custom_fonts/font = SubResource( 1 )
4747
text = "1.
4848
2."
49-

2d/finite_state_machine/debug/states_stack_displayer.gd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
extends Panel
22

3-
onready var fsm_node = get_node("../Player/StateMachine")
4-
5-
func _ready():
6-
set_as_toplevel(true)
3+
onready var fsm_node = get_node("../../Player/StateMachine")
74

85
func _process(delta):
96
var states_names = ''

2d/finite_state_machine/debug/top_level_ui.gd

Lines changed: 0 additions & 5 deletions
This file was deleted.

2d/finite_state_machine/default_env.tres

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ ground_curve = 0.01
1111
[resource]
1212
background_mode = 2
1313
background_sky = SubResource( 1 )
14-

2d/finite_state_machine/icon.png.import

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
importer="texture"
44
type="StreamTexture"
55
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
69

710
[deps]
811

@@ -14,6 +17,7 @@ dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
1417
compress/mode=0
1518
compress/lossy_quality=0.7
1619
compress/hdr_mode=0
20+
compress/bptc_ldr=0
1721
compress/normal_map=0
1822
flags/repeat=0
1923
flags/filter=true
@@ -23,6 +27,7 @@ flags/srgb=2
2327
process/fix_alpha_border=true
2428
process/premult_alpha=false
2529
process/HDR_as_SRGB=false
30+
process/invert_color=false
2631
stream=false
2732
size_limit=0
2833
detect_3d=true

2d/finite_state_machine/player/body.png.import

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
importer="texture"
44
type="StreamTexture"
55
path="res://.import/body.png-313f6363670a5852a7b7126ab476d8b1.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
69

710
[deps]
811

@@ -14,6 +17,7 @@ dest_files=[ "res://.import/body.png-313f6363670a5852a7b7126ab476d8b1.stex" ]
1417
compress/mode=0
1518
compress/lossy_quality=0.7
1619
compress/hdr_mode=0
20+
compress/bptc_ldr=0
1721
compress/normal_map=0
1822
flags/repeat=0
1923
flags/filter=true
@@ -23,6 +27,7 @@ flags/srgb=2
2327
process/fix_alpha_border=true
2428
process/premult_alpha=false
2529
process/HDR_as_SRGB=false
30+
process/invert_color=false
2631
stream=false
2732
size_limit=0
2833
detect_3d=true

2d/finite_state_machine/player/player_controller.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
The Player is a KinematicBody2D, in other words a physics-driven object.
2+
The Player is a KinematicBody2D, in other words a physics-driven object.
33
It can move, collide with the world...
44
It HAS a state machine, but the body and the state machine are separate.
55
"""

0 commit comments

Comments
 (0)