From 4c4edb4bc0dee890aeb7a0d970901a32f4ce0bf6 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Tue, 10 Oct 2023 09:08:31 -0400 Subject: [PATCH] Mennu! --- Scenes/start_menu.tscn | 47 ++++++++++++++++++++++++++++++++++++++++++ Scripts/StartButton.gd | 11 ++++++++++ Scripts/start_menu.gd | 19 +++++++++++++++++ project.godot | 1 + 4 files changed, 78 insertions(+) create mode 100644 Scenes/start_menu.tscn create mode 100644 Scripts/StartButton.gd create mode 100644 Scripts/start_menu.gd diff --git a/Scenes/start_menu.tscn b/Scenes/start_menu.tscn new file mode 100644 index 0000000..08debcd --- /dev/null +++ b/Scenes/start_menu.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=3 format=3 uid="uid://bkt0gdgv7bsx2"] + +[ext_resource type="Script" path="res://Scripts/start_menu.gd" id="1_dgae7"] + +[sub_resource type="LabelSettings" id="LabelSettings_7r5ov"] +font_size = 69 + +[node name="StartMenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_dgae7") + +[node name="Title" type="Label" parent="."] +layout_mode = 0 +offset_left = 272.0 +offset_top = 94.0 +offset_right = 922.0 +offset_bottom = 388.0 +text = "UNTITLED GAME +THAT MAY BE +ABOUT A MONSTER" +label_settings = SubResource("LabelSettings_7r5ov") +horizontal_alignment = 1 + +[node name="StartButton" type="Button" parent="."] +layout_mode = 0 +offset_left = 420.0 +offset_top = 442.0 +offset_right = 558.0 +offset_bottom = 489.0 +text = "Start" + +[node name="QuitButton" type="Button" parent="."] +layout_mode = 0 +offset_left = 570.0 +offset_top = 442.0 +offset_right = 714.0 +offset_bottom = 489.0 +text = "Quit +" + +[connection signal="pressed" from="StartButton" to="." method="_on_start_button_pressed"] +[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"] diff --git a/Scripts/StartButton.gd b/Scripts/StartButton.gd new file mode 100644 index 0000000..7f0ef84 --- /dev/null +++ b/Scripts/StartButton.gd @@ -0,0 +1,11 @@ +extends Button + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/Scripts/start_menu.gd b/Scripts/start_menu.gd new file mode 100644 index 0000000..3108325 --- /dev/null +++ b/Scripts/start_menu.gd @@ -0,0 +1,19 @@ +extends Control + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + + +func _on_start_button_pressed(): + get_tree().change_scene("res://Scenes/level1.tscn") + + +func _on_quit_button_pressed(): + get_tree().quit() diff --git a/project.godot b/project.godot index 1d2c238..703afc7 100644 --- a/project.godot +++ b/project.godot @@ -11,6 +11,7 @@ config_version=5 [application] config/name="GameJam-A23" +run/main_scene="res://Scenes/start_menu.tscn" config/features=PackedStringArray("4.1", "GL Compatibility") config/icon="res://icon.svg"