From fc017ae7983001694b011f9788877b7797b8364d Mon Sep 17 00:00:00 2001 From: LibreHacker Date: Sat, 3 Oct 2020 00:48:41 +0300 Subject: [PATCH] 2 --- Scenes/Earth.tscn | 6 ++++++ Scenes/MainMenu.tscn | 6 ------ Scenes/Menus/MainMenu.tscn | 37 +++++++++++++++++++++++++++++++++++++ Scripts/Earth.cs | 10 ++++++++++ Scripts/MainMenu.cs | 17 +++++------------ project.godot | 2 +- 6 files changed, 59 insertions(+), 19 deletions(-) create mode 100644 Scenes/Earth.tscn delete mode 100644 Scenes/MainMenu.tscn create mode 100644 Scenes/Menus/MainMenu.tscn create mode 100644 Scripts/Earth.cs diff --git a/Scenes/Earth.tscn b/Scenes/Earth.tscn new file mode 100644 index 0000000..c4441f4 --- /dev/null +++ b/Scenes/Earth.tscn @@ -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 ) diff --git a/Scenes/MainMenu.tscn b/Scenes/MainMenu.tscn deleted file mode 100644 index b500f61..0000000 --- a/Scenes/MainMenu.tscn +++ /dev/null @@ -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 ) diff --git a/Scenes/Menus/MainMenu.tscn b/Scenes/Menus/MainMenu.tscn new file mode 100644 index 0000000..ac14132 --- /dev/null +++ b/Scenes/Menus/MainMenu.tscn @@ -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"] diff --git a/Scripts/Earth.cs b/Scripts/Earth.cs new file mode 100644 index 0000000..585366b --- /dev/null +++ b/Scripts/Earth.cs @@ -0,0 +1,10 @@ +using Godot; +using System; + +public class Earth : Node2D +{ + public override void _Ready() + { + + } +} diff --git a/Scripts/MainMenu.cs b/Scripts/MainMenu.cs index 5603f87..fd9438a 100644 --- a/Scripts/MainMenu.cs +++ b/Scripts/MainMenu.cs @@ -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