Ajout d'un menu principal

pull/34/head
Valentin Stark 3 years ago
parent e3f6e6e5d0
commit 029ea030d5
  1. 17
      menu/MainMenu.gd
  2. 47
      menu/MainMenu.tscn
  3. 2
      project.godot
  4. BIN
      theme/fonts/monogram.ttf
  5. 12
      theme/theme.tres

@ -0,0 +1,17 @@
extends Control
func _ready():
pass
func _on_NewButton_pressed():
get_tree().change_scene("res://world/game.tscn")
func _on_LoadButton_pressed():
pass # Replace with function body.
func _on_QuitButton_pressed():
get_tree().quit()

@ -0,0 +1,47 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://theme/theme.tres" type="Theme" id=1]
[ext_resource path="res://menu/MainMenu.gd" type="Script" id=2]
[sub_resource type="Theme" id=1]
[node name="MainMenu" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 2 )
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -158.0
margin_top = -74.5
margin_right = 158.0
margin_bottom = 74.5
[node name="NewButton" type="Button" parent="VBoxContainer"]
margin_right = 316.0
margin_bottom = 47.0
theme = SubResource( 1 )
text = "Nouveau monde"
flat = true
[node name="LoadButton" type="Button" parent="VBoxContainer"]
margin_top = 51.0
margin_right = 316.0
margin_bottom = 98.0
text = "Charger un monde"
flat = true
[node name="QuitButton" type="Button" parent="VBoxContainer"]
margin_top = 102.0
margin_right = 316.0
margin_bottom = 149.0
text = "Quitter"
flat = true
[connection signal="pressed" from="VBoxContainer/NewButton" to="." method="_on_NewButton_pressed"]
[connection signal="pressed" from="VBoxContainer/LoadButton" to="." method="_on_LoadButton_pressed"]
[connection signal="pressed" from="VBoxContainer/QuitButton" to="." method="_on_QuitButton_pressed"]

@ -45,7 +45,7 @@ _global_script_class_icons={
[application] [application]
config/name="Societer" config/name="Societer"
run/main_scene="res://world/game.tscn" run/main_scene="res://menu/MainMenu.tscn"
config/icon="res://icon.png" config/icon="res://icon.png"
[autoload] [autoload]

Binary file not shown.

@ -0,0 +1,12 @@
[gd_resource type="Theme" load_steps=3 format=2]
[sub_resource type="DynamicFontData" id=1]
font_path = "res://theme/fonts/monogram.ttf"
[sub_resource type="DynamicFont" id=2]
size = 50
font_data = SubResource( 1 )
[resource]
Button/colors/font_color_hover = Color( 0.819608, 0.211765, 0.211765, 1 )
Button/fonts/font = SubResource( 2 )
Loading…
Cancel
Save