diff --git a/project.godot b/project.godot index 91a8e3b..076b15d 100644 --- a/project.godot +++ b/project.godot @@ -11,9 +11,18 @@ config_version=5 [application] config/name="LD54" +run/main_scene="res://scenes/main_menu.tscn" config/features=PackedStringArray("4.1", "GL Compatibility") config/icon="res://icon.svg" +[display] + +window/size/viewport_width=1920 +window/size/viewport_height=1080 +window/size/mode=2 +window/size/initial_screen=1 +window/stretch/mode="viewport" + [rendering] renderer/rendering_method="gl_compatibility" diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn new file mode 100644 index 0000000..4d5f24d --- /dev/null +++ b/scenes/main_menu.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=3 format=3 uid="uid://xjo01yx3nybo"] + +[ext_resource type="Script" path="res://scripts/ui/change_scene_button.gd" id="1_2rx5y"] +[ext_resource type="Script" path="res://scripts/ui/quit_button.gd" id="2_fjtya"] + +[node name="root" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="panel" type="Panel" parent="."] +layout_mode = 0 +offset_right = 1928.0 +offset_bottom = 1088.0 + +[node name="titre" type="Label" parent="panel"] +layout_mode = 2 +offset_left = 1.0 +offset_top = 2.0 +offset_right = 961.0 +offset_bottom = 107.0 +scale = Vector2(2, 2) +text = "Ant Underwater Odyssey" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="play" type="Button" parent="."] +layout_mode = 0 +offset_left = 624.0 +offset_top = 776.0 +offset_right = 1279.0 +offset_bottom = 853.0 +text = "Play" +script = ExtResource("1_2rx5y") +TARGET_SCENE = "res://scenes/main_menu.tscn" + +[node name="quit" type="Button" parent="."] +layout_mode = 0 +offset_left = 629.0 +offset_top = 875.0 +offset_right = 1284.0 +offset_bottom = 952.0 +text = "Quit" +script = ExtResource("2_fjtya") diff --git a/scripts/ui/change_scene_button.gd b/scripts/ui/change_scene_button.gd new file mode 100644 index 0000000..2915cd7 --- /dev/null +++ b/scripts/ui/change_scene_button.gd @@ -0,0 +1,8 @@ +extends Button +class_name SceneChanger + +@export_file("*.tscn") var TARGET_SCENE; + +func _pressed(): + print("Changing scene to: " + TARGET_SCENE) + get_tree().change_scene(TARGET_SCENE) diff --git a/scripts/ui/quit_button.gd b/scripts/ui/quit_button.gd new file mode 100644 index 0000000..952d61b --- /dev/null +++ b/scripts/ui/quit_button.gd @@ -0,0 +1,5 @@ +extends Button +class_name QuitButton + +func _pressed(): + get_tree().quit()