Initial commit
This commit is contained in:
commit
03ce3755f5
15 changed files with 245 additions and 0 deletions
23
src/gui/menu/main.gd
Normal file
23
src/gui/menu/main.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
extends Control
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$VBoxContainer/StartButton.grab_focus()
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
|
||||
func _on_start_button_pressed():util
|
||||
get_tree().change_scene("res://game/main.tscn")
|
||||
|
||||
|
||||
func _on_options_button_pressed():
|
||||
var options = load("res://menu/options.tscn").instance()
|
||||
get_tree().current_scene.add_child((options))
|
||||
|
||||
func _on_quit_button_pressed():
|
||||
get_tree().quit()
|
||||
47
src/gui/menu/main.tscn
Normal file
47
src/gui/menu/main.tscn
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bgtkxeh3lciik"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/gui/menu/main.gd" id="1_p5r7q"]
|
||||
|
||||
[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
|
||||
script = ExtResource("1_p5r7q")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -200.0
|
||||
offset_top = -44.0
|
||||
offset_right = 200.0
|
||||
offset_bottom = 156.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="StartButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
focus_neighbor_top = NodePath("../QuitButton")
|
||||
text = "Start!
|
||||
"
|
||||
|
||||
[node name="OptionsButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Options
|
||||
"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
focus_neighbor_bottom = NodePath("../StartButton")
|
||||
text = "Quit"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/OptionsButton" to="." method="_on_options_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
11
src/gui/menu/options.gd
Normal file
11
src/gui/menu/options.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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
|
||||
12
src/gui/menu/options.tscn
Normal file
12
src/gui/menu/options.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://fqg6y7xp34u0"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/gui/menu/options.gd" id="1_0813x"]
|
||||
|
||||
[node name="options" 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_0813x")
|
||||
Loading…
Add table
Add a link
Reference in a new issue