Skip to content

Commit

Permalink
change credits
Browse files Browse the repository at this point in the history
+added a button to exit
+added ESC keybind to exit
davemaster1203 committed Apr 4, 2024
1 parent 8fe7f7a commit 3e590cb
Showing 2 changed files with 37 additions and 8 deletions.
35 changes: 27 additions & 8 deletions menu/credits/scenes/credits.tscn
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[gd_scene load_steps=4 format=3 uid="uid://crbahvojsucv7"]
[gd_scene load_steps=5 format=3 uid="uid://crbahvojsucv7"]

[ext_resource type="Texture2D" uid="uid://cparuessmiwk2" path="res://assets/title.png" id="1_3r1pm"]
[ext_resource type="Script" path="res://menu/credits/scripts/credits.gd" id="1_c2ttd"]
[ext_resource type="Texture2D" uid="uid://drt0rge76ewjf" path="res://assets/Background/Yellow.png" id="1_el70l"]
[ext_resource type="Texture2D" uid="uid://clq8er7nrjgg6" path="res://assets/credits.png" id="3_c35hf"]

[node name="Credits" type="Node2D"]
script = ExtResource("1_c2ttd")

[node name="TextureRect" type="TextureRect" parent="."]
offset_right = 1920.0
@@ -19,26 +21,43 @@ offset_bottom = 632.0
theme_override_constants/margin_top = 200
theme_override_constants/margin_bottom = 200

[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
offset_top = 200.0
offset_right = 1920.0
offset_bottom = 832.0
[node name="VBoxContainer" type="VBoxContainer" parent="."]
offset_left = 370.0
offset_top = 166.0
offset_right = 1612.0
offset_bottom = 833.0

[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 1

[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer"]
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
texture = ExtResource("1_3r1pm")
stretch_mode = 2

[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer"]
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 100
theme_override_constants/margin_right = 100
theme_override_constants/margin_bottom = 200

[node name="TextureRect2" type="TextureRect" parent="MarginContainer/HBoxContainer"]
[node name="TextureRect2" type="TextureRect" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
texture = ExtResource("3_c35hf")
stretch_mode = 2

[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_top = 100

[node name="Button" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 30
text = "ESC to Exit"
flat = true

[connection signal="pressed" from="VBoxContainer/Button" to="." method="_on_button_pressed"]
10 changes: 10 additions & 0 deletions menu/credits/scripts/credits.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends Node2D



func _input(event):
if(Input.is_action_just_pressed("pause_game")):
$VBoxContainer/Button.emit_signal("pressed")

func _on_button_pressed():
get_tree().change_scene_to_file("res://menu/main_menu/scenes/main_menu.tscn")

0 comments on commit 3e590cb

Please sign in to comment.