This commit is contained in:
LibreHacker 2020-10-03 00:48:41 +03:00
parent 0a17bf8103
commit fc017ae798
6 changed files with 59 additions and 19 deletions

6
Scenes/Earth.tscn Normal file
View File

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/Earth.cs" type="Script" id=1]
[node name="Earth" type="Node2D"]
script = ExtResource( 1 )

View File

@ -1,6 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/MainMenu.cs" type="Script" id=1]
[node name="MainMenu" type="Node2D"]
script = ExtResource( 1 )

View File

@ -0,0 +1,37 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/MainMenu.cs" type="Script" id=1]
[node name="MainMenu" type="Node2D"]
script = ExtResource( 1 )
[node name="CenterContainer" type="CenterContainer" parent="."]
margin_right = 1024.0
margin_bottom = 600.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Start" type="Button" parent="CenterContainer"]
margin_left = 491.0
margin_top = 290.0
margin_right = 532.0
margin_bottom = 310.0
text = "Start"
[node name="Options" type="Button" parent="CenterContainer"]
visible = false
margin_left = 480.0
margin_top = 290.0
margin_right = 543.0
margin_bottom = 310.0
text = "Options"
[node name="Exit" type="Button" parent="CenterContainer"]
visible = false
margin_left = 494.0
margin_top = 290.0
margin_right = 529.0
margin_bottom = 310.0
text = "Exit"
[connection signal="pressed" from="CenterContainer/Start" to="." method="_on_Start_pressed"]

10
Scripts/Earth.cs Normal file
View File

@ -0,0 +1,10 @@
using Godot;
using System;
public class Earth : Node2D
{
public override void _Ready()
{
}
}

View File

@ -3,19 +3,12 @@ using System;
public class MainMenu : Node2D
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
var StartButton = GetNode<Button>("Start");
}
private void _on_Start_pressed()
{
GetTree().ChangeScene("res://Scenes/Earth.tscn");
}
// // Called every frame. 'delta' is the elapsed time since the previous frame.
// public override void _Process(float delta)
// {
//
// }
}

View File

@ -16,7 +16,7 @@ _global_script_class_icons={
[application]
config/name="paraBellumSacrum"
run/main_scene="res://Scenes/MainMenu.tscn"
run/main_scene="res://Scenes/Menus/MainMenu.tscn"
config/icon="res://icon.png"
[rendering]