From 7c62361311676b53fb01f7c79f5adfc6b9e287fd Mon Sep 17 00:00:00 2001 From: karl Date: Wed, 29 Jan 2020 12:56:15 +0100 Subject: [PATCH] Quick and dirty credits --- UI/ContentController.gd | 22 +++++++ UI/MainMenu.tscn | 125 ++++++++++++++++++++++++++++++---------- 2 files changed, 117 insertions(+), 30 deletions(-) create mode 100644 UI/ContentController.gd diff --git a/UI/ContentController.gd b/UI/ContentController.gd new file mode 100644 index 0000000..15ed0b3 --- /dev/null +++ b/UI/ContentController.gd @@ -0,0 +1,22 @@ +extends VBoxContainer + + +onready var embark = get_node("EmbarkControls") +onready var credits = get_node("CreditsControls") + + +func _ready(): + show_embark() + + embark.get_node("VBoxContainer/CreditsButton").connect("button_up", self, "show_credits") + credits.get_node("VBoxContainer/BackButton").connect("button_up", self, "show_embark") + + +func show_embark(): + embark.visible = true + credits.visible = false + + +func show_credits(): + embark.visible = false + credits.visible = true \ No newline at end of file diff --git a/UI/MainMenu.tscn b/UI/MainMenu.tscn index 68991e5..cb6984f 100644 --- a/UI/MainMenu.tscn +++ b/UI/MainMenu.tscn @@ -1,20 +1,21 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] -[ext_resource path="res://Resources/Fonts/Beon-Regular.otf" type="DynamicFontData" id=1] -[ext_resource path="res://UI/PlayButton.gd" type="Script" id=2] -[ext_resource path="res://UI/ExitButton.gd" type="Script" id=3] +[ext_resource path="res://UI/ContentController.gd" type="Script" id=1] +[ext_resource path="res://Resources/Fonts/Beon-Regular.otf" type="DynamicFontData" id=2] +[ext_resource path="res://UI/PlayButton.gd" type="Script" id=3] +[ext_resource path="res://UI/ExitButton.gd" type="Script" id=4] [sub_resource type="DynamicFont" id=1] size = 180 -font_data = ExtResource( 1 ) +font_data = ExtResource( 2 ) [sub_resource type="DynamicFont" id=2] size = 32 -font_data = ExtResource( 1 ) +font_data = ExtResource( 2 ) [sub_resource type="DynamicFont" id=3] size = 32 -font_data = ExtResource( 1 ) +font_data = ExtResource( 2 ) [sub_resource type="Animation" id=4] length = 5.0 @@ -31,7 +32,7 @@ tracks/0/keys = { "values": [ Vector2( 0, 0 ), Vector2( 0, -200 ) ] } tracks/1/type = "value" -tracks/1/path = NodePath("VBoxContainer/CenterContainer2/GameTitle/ForegroundGoesLeft:rect_size") +tracks/1/path = NodePath("ContentController/Title/GameTitle/ForegroundGoesLeft:rect_size") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false @@ -55,7 +56,7 @@ tracks/2/keys = { "values": [ 0.0, -30.0 ] } tracks/3/type = "value" -tracks/3/path = NodePath("VBoxContainer/CenterContainer2/GameTitle/ForegroundGoesLeft:visible") +tracks/3/path = NodePath("ContentController/Title/GameTitle/ForegroundGoesLeft:visible") tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/imported = false @@ -85,22 +86,23 @@ margin_bottom = 900.0 rect_min_size = Vector2( 1600, 300 ) color = Color( 1, 0, 0, 1 ) -[node name="VBoxContainer" type="VBoxContainer" parent="."] +[node name="ContentController" type="VBoxContainer" parent="."] margin_right = 1600.0 margin_bottom = 900.0 +script = ExtResource( 1 ) -[node name="CenterContainer2" type="CenterContainer" parent="VBoxContainer"] +[node name="Title" type="CenterContainer" parent="ContentController"] margin_right = 1600.0 -margin_bottom = 596.0 +margin_bottom = 584.0 rect_min_size = Vector2( 1600, 0 ) size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="GameTitle" type="Label" parent="VBoxContainer/CenterContainer2"] +[node name="GameTitle" type="Label" parent="ContentController/Title"] margin_left = 404.0 -margin_top = 190.0 +margin_top = 184.0 margin_right = 1195.0 -margin_bottom = 406.0 +margin_bottom = 400.0 size_flags_horizontal = 3 size_flags_vertical = 3 custom_fonts/font = SubResource( 1 ) @@ -111,24 +113,26 @@ text = "Retrace" align = 1 valign = 1 -[node name="ForegroundGoesLeft" type="ColorRect" parent="VBoxContainer/CenterContainer2/GameTitle"] +[node name="ForegroundGoesLeft" type="ColorRect" parent="ContentController/Title/GameTitle"] margin_right = 220.0 margin_bottom = 200.0 -[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer"] -margin_top = 600.0 +[node name="EmbarkControls" type="CenterContainer" parent="ContentController"] +visible = false +margin_top = 276.0 margin_right = 1600.0 -margin_bottom = 900.0 +margin_bottom = 584.0 -[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/CenterContainer"] -margin_right = 1600.0 -margin_bottom = 300.0 +[node name="VBoxContainer" type="VBoxContainer" parent="ContentController/EmbarkControls"] +margin_left = 704.0 +margin_right = 895.0 +margin_bottom = 308.0 rect_min_size = Vector2( 0, 300 ) size_flags_horizontal = 0 size_flags_vertical = 0 -[node name="PlayButton" type="Button" parent="VBoxContainer/CenterContainer/VBoxContainer"] -margin_right = 1600.0 +[node name="PlayButton" type="Button" parent="ContentController/EmbarkControls/VBoxContainer"] +margin_right = 191.0 margin_bottom = 100.0 rect_min_size = Vector2( 0, 100 ) custom_fonts/font = SubResource( 2 ) @@ -136,11 +140,11 @@ custom_colors/font_color = Color( 1, 1, 1, 1 ) custom_colors/font_color_hover = Color( 0.980392, 0.839216, 0.619608, 1 ) text = "Embark" flat = true -script = ExtResource( 2 ) +script = ExtResource( 3 ) -[node name="ExitButton" type="Button" parent="VBoxContainer/CenterContainer/VBoxContainer"] +[node name="ExitButton" type="Button" parent="ContentController/EmbarkControls/VBoxContainer"] margin_top = 104.0 -margin_right = 1600.0 +margin_right = 191.0 margin_bottom = 204.0 rect_min_size = Vector2( 0, 100 ) custom_fonts/font = SubResource( 3 ) @@ -148,7 +152,68 @@ custom_colors/font_color = Color( 1, 1, 1, 1 ) custom_colors/font_color_hover = Color( 0, 0, 0, 1 ) text = "Disembark" flat = true -script = ExtResource( 3 ) +script = ExtResource( 4 ) + +[node name="CreditsButton" type="Button" parent="ContentController/EmbarkControls/VBoxContainer"] +margin_top = 208.0 +margin_right = 191.0 +margin_bottom = 308.0 +rect_min_size = Vector2( 0, 100 ) +custom_fonts/font = SubResource( 2 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.980392, 0.839216, 0.619608, 1 ) +text = "Credits" +flat = true + +[node name="CreditsControls" type="CenterContainer" parent="ContentController"] +margin_top = 588.0 +margin_right = 1600.0 +margin_bottom = 896.0 + +[node name="VBoxContainer" type="VBoxContainer" parent="ContentController/CreditsControls"] +margin_left = 483.0 +margin_right = 1117.0 +margin_bottom = 308.0 +rect_min_size = Vector2( 0, 300 ) +size_flags_horizontal = 0 +size_flags_vertical = 0 + +[node name="TextButton" type="Button" parent="ContentController/CreditsControls/VBoxContainer"] +margin_right = 634.0 +margin_bottom = 100.0 +rect_min_size = Vector2( 0, 100 ) +custom_fonts/font = SubResource( 2 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.980392, 0.839216, 0.619608, 1 ) +text = "Karl Bittner Michael Leithner" +flat = true + +[node name="TextButton2" type="Button" parent="ContentController/CreditsControls/VBoxContainer"] +margin_top = 104.0 +margin_right = 634.0 +margin_bottom = 204.0 +rect_min_size = Vector2( 0, 100 ) +custom_fonts/font = SubResource( 2 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.980392, 0.839216, 0.619608, 1 ) +text = "Leon Palluch Nino Schmidt" +flat = true + +[node name="BackButton" type="Button" parent="ContentController/CreditsControls/VBoxContainer"] +margin_top = 208.0 +margin_right = 634.0 +margin_bottom = 308.0 +rect_min_size = Vector2( 0, 100 ) +custom_fonts/font = SubResource( 2 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.980392, 0.839216, 0.619608, 1 ) +text = "Back" +flat = true + +[node name="Control" type="Control" parent="ContentController"] +margin_top = 900.0 +margin_right = 1600.0 +margin_bottom = 900.0 [node name="ForegroundGoesUp" type="ColorRect" parent="."] visible = false @@ -160,5 +225,5 @@ rect_rotation = -30.0 [node name="AnimateForeground" type="AnimationPlayer" parent="."] autoplay = "Text" anims/Text = SubResource( 4 ) -[connection signal="pressed" from="VBoxContainer/CenterContainer/VBoxContainer/PlayButton" to="VBoxContainer/CenterContainer/VBoxContainer/PlayButton" method="_on_PlayButton_pressed"] -[connection signal="pressed" from="VBoxContainer/CenterContainer/VBoxContainer/ExitButton" to="VBoxContainer/CenterContainer/VBoxContainer/ExitButton" method="_on_ExitButton_pressed"] +[connection signal="pressed" from="ContentController/EmbarkControls/VBoxContainer/PlayButton" to="ContentController/EmbarkControls/VBoxContainer/PlayButton" method="_on_PlayButton_pressed"] +[connection signal="pressed" from="ContentController/EmbarkControls/VBoxContainer/ExitButton" to="ContentController/EmbarkControls/VBoxContainer/ExitButton" method="_on_ExitButton_pressed"]