diff --git a/game/project.godot b/game/project.godot index 1c56468..ecdf600 100644 --- a/game/project.godot +++ b/game/project.godot @@ -14,7 +14,7 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://src/Piece.gd" }, { -"base": "Node2D", +"base": "Control", "class": "Taquin", "language": "GDScript", "path": "res://src/Taquin.gd" diff --git a/game/src/Main.tscn b/game/src/Main.tscn index 4c9656c..b62d395 100644 --- a/game/src/Main.tscn +++ b/game/src/Main.tscn @@ -8,5 +8,25 @@ anchor_right = 1.0 anchor_bottom = 1.0 script = ExtResource( 1 ) -[node name="Taquin" parent="." instance=ExtResource( 2 )] -[connection signal="solved" from="Taquin" to="." method="_on_Taquin_solved"] +[node name="HSplitContainer" type="HSplitContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 20.0 +margin_top = 20.0 +margin_right = -20.0 +margin_bottom = -20.0 + +[node name="Taquin" parent="HSplitContainer" instance=ExtResource( 2 )] +margin_right = 540.0 +margin_bottom = 560.0 + +[node name="VSplitContainer" type="VSplitContainer" parent="HSplitContainer"] +margin_left = 552.0 +margin_right = 984.0 +margin_bottom = 560.0 + +[node name="Button" type="Button" parent="HSplitContainer/VSplitContainer"] +margin_right = 432.0 +margin_bottom = 560.0 +text = "New game" +[connection signal="solved" from="HSplitContainer/Taquin" to="." method="_on_Taquin_solved"] diff --git a/game/src/Taquin.gd b/game/src/Taquin.gd index c5f171f..0ab890b 100644 --- a/game/src/Taquin.gd +++ b/game/src/Taquin.gd @@ -1,4 +1,4 @@ -extends Node2D +extends Control class_name Taquin tool diff --git a/game/src/Taquin.tscn b/game/src/Taquin.tscn index 4061153..8b2c6eb 100644 --- a/game/src/Taquin.tscn +++ b/game/src/Taquin.tscn @@ -20,7 +20,8 @@ tracks/0/keys = { "values": [ Vector2( 15, 15 ), Vector2( 175, 15 ) ] } -[node name="Taquin" type="Node2D"] +[node name="Taquin" type="Control"] +rect_min_size = Vector2( 540, 540 ) script = ExtResource( 1 ) rows = 3 columns = 3