Added menu

This commit is contained in:
EljakimHerrewijnen 2020-09-21 15:18:10 +02:00
parent 58ffd327a8
commit b65ed88772
11 changed files with 84 additions and 3 deletions

21
Menu.gd Normal file
View File

@ -0,0 +1,21 @@
extends Node2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# 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
func _on_Btn_PlayGame_pressed():
get_tree().change_scene("res://river_intersection_home2.tscn")
pass # Replace with function body.

17
Menu.tscn Normal file
View File

@ -0,0 +1,17 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Menu.gd" type="Script" id=1]
[node name="Main Menu" type="Node2D"]
script = ExtResource( 1 )
[node name="Btn_PlayGame" type="Button" parent="."]
margin_left = 484.204
margin_top = 100.226
margin_right = 679.204
margin_bottom = 153.226
text = "Play Game"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="Btn_PlayGame" to="." method="_on_Btn_PlayGame_pressed"]

16
Menu_Buttons.gd Normal file
View File

@ -0,0 +1,16 @@
extends Button
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# 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

27
Menu_PlayGame.gd Normal file
View File

@ -0,0 +1,27 @@
extends Button
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# 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
func _on_Button_gui_input(event):
print(event)
if event == InputEventScreenTouch.CONNECT_ONESHOT:
get_tree().change_scene("res://river_intersection_home2.tscn")
# get_tree().change_scene("res://river_intersection_home2.tscn")
pass # Replace with function body.

Binary file not shown.

View File

@ -16,7 +16,7 @@ _global_script_class_icons={
[application]
config/name="Ring of Races demo"
run/main_scene="res://river_intersection_home2.tscn"
run/main_scene="res://Menu.tscn"
config/icon="res://icon.png"
[autoload]

File diff suppressed because one or more lines are too long