From 885da14ee2c7e9f644ccce79f297a2ebb6b46c47 Mon Sep 17 00:00:00 2001 From: Ravjot Singh Date: Wed, 12 Feb 2025 22:53:16 +0530 Subject: [PATCH] Add: Basic Strcture of Main_Menu Scene Signed-off-by: Ravjot Singh --- MainMenu/menu.gd | 10 ++++++++++ MainMenu/menu.tscn | 50 ++++++++++++++++++++++++++++++++++++++++++++++ project.godot | 2 +- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 MainMenu/menu.gd create mode 100644 MainMenu/menu.tscn diff --git a/MainMenu/menu.gd b/MainMenu/menu.gd new file mode 100644 index 0000000..f3dade1 --- /dev/null +++ b/MainMenu/menu.gd @@ -0,0 +1,10 @@ +extends Control + + + +func _on_play_pressed() -> void: + get_tree().change_scene_to_file("res://Scenes/boxClick.tscn") + + +func _on_play_2_pressed() -> void: + get_tree().quit() diff --git a/MainMenu/menu.tscn b/MainMenu/menu.tscn new file mode 100644 index 0000000..992e2a4 --- /dev/null +++ b/MainMenu/menu.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=3 format=3 uid="uid://cej0qnviiccuf"] + +[ext_resource type="Script" path="res://MainMenu/menu.gd" id="1_b4ol1"] +[ext_resource type="Texture2D" uid="uid://crbbdu26tlg2k" path="res://2D Assets/background.png" id="2_5fg15"] + +[node name="Menu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +scale = Vector2(0.920002, 0.72) +script = ExtResource("1_b4ol1") + +[node name="TextureRect" type="TextureRect" parent="."] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 +scale = Vector2(0.662872, 0.888889) +texture = ExtResource("2_5fg15") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 0 +offset_left = 491.303 +offset_top = 262.5 +offset_right = 813.303 +offset_bottom = 692.5 +scale = Vector2(0.927556, 0.944004) + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="Play" type="Button" parent="MarginContainer/VBoxContainer"] +modulate = Color(0, 0, 0, 1) +layout_mode = 2 +theme_override_font_sizes/font_size = 150 +text = "Play" +flat = true + +[node name="Play2" type="Button" parent="MarginContainer/VBoxContainer"] +modulate = Color(0, 0, 0, 1) +layout_mode = 2 +theme_override_font_sizes/font_size = 150 +text = "Quit +" +flat = true + +[connection signal="pressed" from="MarginContainer/VBoxContainer/Play" to="." method="_on_play_pressed"] +[connection signal="pressed" from="MarginContainer/VBoxContainer/Play2" to="." method="_on_play_2_pressed"] diff --git a/project.godot b/project.godot index abe1256..8dd9637 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="eventing-game" -run/main_scene="res://Scenes/boxClick.tscn" +run/main_scene="res://MainMenu/menu.tscn" config/features=PackedStringArray("4.3", "GL Compatibility") config/icon="res://icon.svg"