diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-11-15 02:22:02 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-11-15 02:22:02 +0100 |
| commit | b81e08abe033cdbd9f1e2560a95bd130902a104e (patch) | |
| tree | 45103c9ddb1edd3084ac4241dfe761a0563557c1 | |
| parent | a0b19d6ff35bc98eb2bb39cd289eaa28c5f76bf9 (diff) | |
| download | nj26-b81e08abe033cdbd9f1e2560a95bd130902a104e.tar.gz | |
Add credits menu
| -rw-r--r-- | credits.gd | 10 | ||||
| -rw-r--r-- | credits.tscn | 91 | ||||
| -rw-r--r-- | mainmenu.gd | 11 | ||||
| -rw-r--r-- | mainmenu.tscn | 39 |
4 files changed, 139 insertions, 12 deletions
diff --git a/credits.gd b/credits.gd new file mode 100644 index 0000000..9769daa --- /dev/null +++ b/credits.gd @@ -0,0 +1,10 @@ +extends Node2D + +func back(): + var mainmenu = load("res://mainmenu.tscn").instance() + + get_tree().root.add_child(mainmenu) + get_tree().root.remove_child(self) + +func _ready(): + $CanvasLayer/CenterContainer3/back.connect("button_up", self, "back") diff --git a/credits.tscn b/credits.tscn new file mode 100644 index 0000000..eda6f38 --- /dev/null +++ b/credits.tscn @@ -0,0 +1,91 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://bg.png" type="Texture" id=1] +[ext_resource path="res://vera/VeraBd.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://vera/Vera.ttf" type="DynamicFontData" id=3] +[ext_resource path="res://credits.gd" type="Script" id=4] + +[sub_resource type="DynamicFont" id=1] +size = 120 +use_filter = true +font_data = ExtResource( 2 ) + +[sub_resource type="DynamicFont" id=2] +size = 60 +use_filter = true +font_data = ExtResource( 3 ) + +[sub_resource type="DynamicFont" id=3] +size = 48 +font_data = ExtResource( 2 ) + +[node name="Node2D" type="Node2D"] +script = ExtResource( 4 ) + +[node name="TextureRect" type="TextureRect" parent="."] +margin_right = 1920.0 +margin_bottom = 1080.0 +texture = ExtResource( 1 ) + +[node name="CanvasLayer" type="CanvasLayer" parent="."] + +[node name="CenterContainer" type="CenterContainer" parent="CanvasLayer"] +anchor_left = 0.5 +anchor_top = 0.1 +anchor_right = 0.5 +anchor_bottom = 0.1 +margin_right = 40.0 +margin_bottom = 40.0 +use_top_left = true + +[node name="Label" type="Label" parent="CanvasLayer/CenterContainer"] +margin_left = -242.0 +margin_top = -71.0 +margin_right = 241.0 +margin_bottom = 70.0 +custom_fonts/font = SubResource( 1 ) +text = "Credits" + +[node name="CenterContainer2" type="CenterContainer" parent="CanvasLayer"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.575 +margin_right = 40.0 +margin_bottom = 40.0 +use_top_left = true + +[node name="Label" type="Label" parent="CanvasLayer/CenterContainer2"] +margin_left = -298.0 +margin_top = -332.0 +margin_right = 298.0 +margin_bottom = 331.0 +custom_fonts/font = SubResource( 2 ) +text = "Ainoa - Animation +Alba - Animation +Berta - Animation +Gian - Animation +Kam - Animation +Kat - Animation +## - Aniamtion +Xavi - Programming +Xenia - Animation" +align = 1 +valign = 1 + +[node name="CenterContainer3" type="CenterContainer" parent="CanvasLayer"] +anchor_left = 0.5 +anchor_top = 0.892 +anchor_right = 0.5 +anchor_bottom = 0.892 +margin_right = 40.0 +margin_bottom = 40.0 +use_top_left = true + +[node name="back" type="Button" parent="CanvasLayer/CenterContainer3"] +margin_left = -71.0 +margin_top = -32.0 +margin_right = 70.0 +margin_bottom = 31.0 +custom_fonts/font = SubResource( 3 ) +text = "Back" diff --git a/mainmenu.gd b/mainmenu.gd index 5d01c12..213e518 100644 --- a/mainmenu.gd +++ b/mainmenu.gd @@ -1,11 +1,16 @@ extends Node2D -var game = load("res://Spatial.tscn").instance() - +var game = preload("res://Spatial.tscn").instance() +var credits = preload("res://credits.tscn").instance() func start(): get_tree().root.add_child(game) get_tree().root.remove_child(self) +func run_credits(): + get_tree().root.add_child(credits) + get_tree().root.remove_child(self) + func _ready(): - $CanvasLayer/CenterContainer2/Button.connect("button_up", self, "start") + $cl/c2/play.connect("button_up", self, "start") + $cl/c3/credits.connect("button_up", self, "run_credits") diff --git a/mainmenu.tscn b/mainmenu.tscn index 7edd3c1..d38afe2 100644 --- a/mainmenu.tscn +++ b/mainmenu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://bg.png" type="Texture" id=1] [ext_resource path="res://vera/VeraBI.ttf" type="DynamicFontData" id=2] @@ -15,17 +15,21 @@ size = 120 use_filter = true font_data = ExtResource( 3 ) +[sub_resource type="DynamicFont" id=3] +size = 64 +font_data = ExtResource( 3 ) + [node name="Node2D" type="Node2D"] script = ExtResource( 4 ) -[node name="CanvasLayer" type="CanvasLayer" parent="."] +[node name="cl" type="CanvasLayer" parent="."] -[node name="TextureRect" type="TextureRect" parent="CanvasLayer"] +[node name="TextureRect" type="TextureRect" parent="cl"] margin_right = 1920.0 margin_bottom = 1080.0 texture = ExtResource( 1 ) -[node name="CenterContainer3" type="CenterContainer" parent="CanvasLayer"] +[node name="CenterContainer3" type="CenterContainer" parent="cl"] anchor_left = 0.221 anchor_top = 0.664 anchor_right = 0.5 @@ -34,14 +38,14 @@ margin_right = 40.0 margin_bottom = 40.0 use_top_left = true -[node name="TextureRect" type="TextureRect" parent="CanvasLayer/CenterContainer3"] +[node name="TextureRect" type="TextureRect" parent="cl/CenterContainer3"] margin_left = -320.0 margin_top = -320.0 margin_right = 320.0 margin_bottom = 320.0 texture = ExtResource( 5 ) -[node name="CenterContainer" type="CenterContainer" parent="CanvasLayer"] +[node name="cc" type="CenterContainer" parent="cl"] anchor_left = 0.5 anchor_top = 0.3 anchor_right = 0.5 @@ -50,7 +54,7 @@ margin_right = 40.0 margin_bottom = 40.0 use_top_left = true -[node name="Label" type="Label" parent="CanvasLayer/CenterContainer"] +[node name="Label" type="Label" parent="cl/cc"] margin_left = -607.0 margin_top = -106.0 margin_right = 606.0 @@ -58,7 +62,7 @@ margin_bottom = 105.0 custom_fonts/font = SubResource( 1 ) text = "Eat the Cat!" -[node name="CenterContainer2" type="CenterContainer" parent="CanvasLayer"] +[node name="c2" type="CenterContainer" parent="cl"] anchor_left = 0.5 anchor_top = 0.7 anchor_right = 0.5 @@ -67,10 +71,27 @@ margin_right = 40.0 margin_bottom = 40.0 use_top_left = true -[node name="Button" type="Button" parent="CanvasLayer/CenterContainer2"] +[node name="play" type="Button" parent="cl/c2"] margin_left = -148.0 margin_top = -74.0 margin_right = 148.0 margin_bottom = 73.0 custom_fonts/font = SubResource( 2 ) text = "Play" + +[node name="c3" type="CenterContainer" parent="cl"] +anchor_left = 0.5 +anchor_top = 0.87 +anchor_right = 0.5 +anchor_bottom = 0.87 +margin_right = 40.0 +margin_bottom = 40.0 +use_top_left = true + +[node name="credits" type="Button" parent="cl/c3"] +margin_left = -136.0 +margin_top = -41.0 +margin_right = 135.0 +margin_bottom = 41.0 +custom_fonts/font = SubResource( 3 ) +text = "Credits" |
