From 8345032169d5f0de4c812644b4f5446f5235c315 Mon Sep 17 00:00:00 2001 From: hpham474 Date: Wed, 20 Oct 2021 12:10:18 -0500 Subject: [PATCH] Added Options menu exit functionality --- godot_ship/scenes/Options.tscn | 6 +++++- godot_ship/script/options/Options.gd | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 godot_ship/script/options/Options.gd diff --git a/godot_ship/scenes/Options.tscn b/godot_ship/scenes/Options.tscn index 9c96fe0..d839c7c 100644 --- a/godot_ship/scenes/Options.tscn +++ b/godot_ship/scenes/Options.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://script/options/Option-Background.png" type="Texture" id=1] +[ext_resource path="res://script/options/Options.gd" type="Script" id=2] [node name="Options" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 +script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false } @@ -121,3 +123,5 @@ __meta__ = { "_edit_lock_": true, "_edit_use_anchors_": false } + +[connection signal="pressed" from="Button" to="." method="_on_Button_pressed"] diff --git a/godot_ship/script/options/Options.gd b/godot_ship/script/options/Options.gd new file mode 100644 index 0000000..37cd49f --- /dev/null +++ b/godot_ship/script/options/Options.gd @@ -0,0 +1,19 @@ +extends Control + + +# 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_pressed(): + queue_free()