From 89b515b278b3e29c2dbb9c58f1f3fd2644a78be8 Mon Sep 17 00:00:00 2001 From: Simon Dalvai Date: Wed, 14 Feb 2024 21:45:48 +0100 Subject: [PATCH] add fade effect to all scenes --- game/assets/i18n/UltimateTossi18n.csv | 2 +- .../i18n/UltimateTossi18n.de.translation | Bin 1008 -> 1004 bytes .../i18n/UltimateTossi18n.en.translation | Bin 945 -> 945 bytes .../i18n/UltimateTossi18n.es.translation | Bin 996 -> 996 bytes .../i18n/UltimateTossi18n.it.translation | Bin 984 -> 984 bytes game/grabber-style.tres | 46 --------------- game/project.godot | 3 +- game/splash.png | Bin 614 -> 0 bytes game/splash.png.import | 35 ------------ game/src/fade-effect/FadeEffect.gd | 43 ++++++++++++++ game/src/fade-effect/FadeEffect.tscn | 6 ++ game/src/screens/help/Help.tscn | 6 +- game/src/screens/info/Info.tscn | 6 +- .../screens/level-complete/LevelComplete.tscn | 7 ++- .../src/screens/level-select/LevelSelect.tscn | 6 +- game/src/screens/main/Main.gd | 5 +- game/src/screens/main/Main.tscn | 53 ++---------------- game/src/screens/shop/Shop.tscn | 6 +- game/{ => styles}/button-transparent.tres | 0 game/{ => styles}/panel.tres | 0 game/theme.tres | 4 +- 21 files changed, 85 insertions(+), 143 deletions(-) delete mode 100644 game/grabber-style.tres delete mode 100644 game/splash.png delete mode 100644 game/splash.png.import create mode 100644 game/src/fade-effect/FadeEffect.gd create mode 100644 game/src/fade-effect/FadeEffect.tscn rename game/{ => styles}/button-transparent.tres (100%) rename game/{ => styles}/panel.tres (100%) diff --git a/game/assets/i18n/UltimateTossi18n.csv b/game/assets/i18n/UltimateTossi18n.csv index 6fcb6c6..25bfdb3 100644 --- a/game/assets/i18n/UltimateTossi18n.csv +++ b/game/assets/i18n/UltimateTossi18n.csv @@ -14,5 +14,5 @@ FOLLOW,follow,folge,segui,sigue MORE_GAMES,games,spiele,giochi,juegos NEXT,next,nächstes,prossimo,próximo HELP,skip level,level übers.,salta livello,saltar nivel -HELP_INSTRUCTIONS,1. Get a friend's yellow code\n2. Put into red text box\n\nCodes regenerate at midnight!,1. Besorg dir ein gelben Code eines Freundes\n2. Gib ihn ins rote Textfeld\n\nDie Codes werden um Mitternacht erneuert!,1. Ottieni un codice giallo di un amico\n2. Mettilo nella casella di testo rossa\n\nI codici si rigenerano a mezzanotte!,1. Consigue un código amarillo de un amigo\n2. Ponelo en la caja de texto roja\n\nLos códigos se regeneran a medianoche! +HELP_INSTRUCTIONS,1. Get a friend's yellow code\n2. Put into red text box\n\nCodes regenerate at midnight!,1. Besorg dir ein gelben Code eines Freundes\n2. Gib ihn ins rote Textfeld ein\n\nCodes werden um Mitternacht erneuert!,1. Ottieni un codice giallo di un amico\n2. Mettilo nella casella di testo rossa\n\nI codici si rigenerano a mezzanotte!,1. Consigue un código amarillo de un amigo\n2. Ponelo en la caja de texto roja\n\nLos códigos se regeneran a medianoche! PASTE,code,Kode,codice,codigo diff --git a/game/assets/i18n/UltimateTossi18n.de.translation b/game/assets/i18n/UltimateTossi18n.de.translation index 9c13b2e0cab0880851125b961489e383143e7242..e66de1273b0ca673485feae3229bc3240efd7f41 100644 GIT binary patch delta 377 zcmeys{)T3-F+SY-8NStfPOZ9o|oC|)~6U)q(D1Uo9r*GKn)PPHtt= zx7`F)4>FZW`D>*pkOr|qZe#*tkiH9?<;!*fX&xZv1LBr2#~Xe?I&AVsCgGGNKo-c2 zAPmwa55#AH_@`sD5c5BV@O&|@e+(>YIyOx+{xRGU`}vQ7%Z6i zwG4TOmn3Htm!uXmB$gJJA6}A?lbXliou87*uzluQvB`PNW~_2d{Dy{;S2N4%WG9xU r0i}xzGE;L>8KMgQG34YIgUtKScz93D-MoJcxv6=F_b>zn2RQ=({3u#6 delta 426 zcmaFE{(*hN7Dma#3=9lxP|OIVLHNkY7!j4pXBovUMSwgGAm#+(&7Y1O^aaxFP_e9& zx_?gs*{o0u)BUPtu?X*EStfN&8K4Xc6tA0SI717_=7M6F>Ol9huWKgfGKn)fOm1b; zw^e|u2bs#G{I${=NQ2lQH!=Y+NZ$p{@@3nBG!GE-0dY&1i3jN+2iVutL*(zMh(hC5D&sTp3=X)V#>25V?=KqX}42h-1 o<%gGKw&C^*O&07k)U1^@s6 diff --git a/game/assets/i18n/UltimateTossi18n.en.translation b/game/assets/i18n/UltimateTossi18n.en.translation index 074c2ac373c4a87c3aaa833c5867b230f3c000f0..7d269c4ffaeeff06217b62bdda4014a3f48ec97f 100644 GIT binary patch delta 311 zcmdnUzL9;yQbx%+3=9k`K+Fonj8J^!WQ>T_KubXE$LmSA3>4w=A=w9~KU~(LjIHTO;GA4b? zE+i9~l)qLA1Nkr)Fag;heHS>(mrVrH+)&&S=6J(l@;#s#4U@kysTf5?KVkaEaAyXa z<3EOioWx3o@cb?Rs#$cS1O7ACGUTOJlrY4H%P{|AD9!rEplH(>{BLqFv!hB(hV*=f;_S=Ty@;#s#+LOOAsaU2b=B5@iL`6Sg z`p1x-&k$Ack3rFof_|I6&P>_>YIoXHV jQ8qqYhWQ^uadu{bLQZN~Y7WC6wSNqyS^pSUY8P3oI(wtBXQyu7D_SI-|E|WN;%;Z)k zeaqEAd6uz!h=An{(Hue++-r{xL8F1qV3;08sT! ADF6Tf delta 325 zcmaFD{)BzQ7DmaP3=9k`K+Fonj8J^!WQ>T?#@tq`3}U2{4M{gS#+ZV{xjAx*c2~&1eA{tzn#tUkD;`& z;~ztj^#mD~f0MJA12jr?ZJPcuSWlSA@sGi#fFG!$EHRUTE8@i2U7N&!+Wx5hV+aZk Gas~jKa!lI* delta 323 zcmcb?euI6(7DmbS3=9k`K+Fonj8J^!WQ>T?ARDBU9f)DNU$rb2;hHSVq^>Ce6a|?L!t3T4&d>zXAeA7~V5$S%%f8N=oXaH6 zXfwH$N#9ZiCM*Ge-eA0);E#2|eaILntU1=3tV%m>6RVU9QaC%*-nVKAAM zS<%IM!c2~T3`M$85x3d?F_a}{GT0RGvj9b`C&&OPo8o1Ufa0aPHckH+ic`}|Ga173 zxBRPS(TxuH&sfWlo|&JVI5~kiKrTM~b~aE0SHy|4yEcgd_54u->TB%y#}E`8c}*5j~)%+dJhrCOqn)*gi?0_N&;by;MIb_FP2;aY1oBjy*Yuhb+Farc8;A3Qjo zboJoT$Z+;>M}a>Kg(XEnB@>1IPZxGCd1B|zvgJDJ+$2S?&0Itu|4UP^M4nA(XyP(XxCUV?PZ(m9!HzKnJ?#j z?>xLlL-WY!nGEac%fj4}=KS(0J@?qR=0-NYE9 zon8q~A{7?;d|) z^au_=DgEGqfP`kiw_V3~@4i+2`@7HP{qi&Fing_$TK63oEo@2N?k+$Y2!1;6t_M<_ z1s;*b3=De8Ak0{?)V>TT$X?><>&pI&Q&>n%W7VE1|A9i1C9V-A&iT2ysd*&~&PAz- zC8;S2<(VZJ3hti10pX2&;y^`qo-U3d6}R3VG-L$w4lVfVpUbVk0LUZ)G%RPFvxI^1 SMzu^FNVTV{pUXO@geCxF!|Uq+ diff --git a/game/splash.png.import b/game/splash.png.import deleted file mode 100644 index fab3fd8..0000000 --- a/game/splash.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/splash.png-929ed8a00b89ba36c51789452f874c77.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://splash.png" -dest_files=[ "res://.import/splash.png-929ed8a00b89ba36c51789452f874c77.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/game/src/fade-effect/FadeEffect.gd b/game/src/fade-effect/FadeEffect.gd new file mode 100644 index 0000000..62df2fc --- /dev/null +++ b/game/src/fade-effect/FadeEffect.gd @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: 2023 Simon Dalvai + +# SPDX-License-Identifier: AGPL-3.0-or-later + +extends Tween + +const DURATON:float = 0.2 + +export var node_path:NodePath +export var node_path2:NodePath + +var node:Node +var node2:Node + +func _ready() -> void: + if node_path: + node = get_node(node_path) + + if node_path2: + node2 = get_node(node_path2) + + if node: + node.modulate = Color(1, 1, 1, 0) + node.connect("visibility_changed", self, "fade_in") + if node2: + node2.modulate = Color(1, 1, 1, 0) + node2.connect("visibility_changed", self, "fade_in") + + + fade_in() + + +func fade_in() -> void: + if node: + interpolate_property(node, "modulate", + Color(1, 1, 1, 0), Color(1, 1, 1, 1), DURATON, + Tween.TRANS_LINEAR, Tween.EASE_IN) + start() + if node2: + interpolate_property(node2, "modulate", + Color(1, 1, 1, 0), Color(1, 1, 1, 1), DURATON, + Tween.TRANS_LINEAR, Tween.EASE_IN) + start() diff --git a/game/src/fade-effect/FadeEffect.tscn b/game/src/fade-effect/FadeEffect.tscn new file mode 100644 index 0000000..a197c1e --- /dev/null +++ b/game/src/fade-effect/FadeEffect.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/fade-effect/FadeEffect.gd" type="Script" id=1] + +[node name="FadeEffect" type="Tween"] +script = ExtResource( 1 ) diff --git a/game/src/screens/help/Help.tscn b/game/src/screens/help/Help.tscn index 893948b..9e60c30 100644 --- a/game/src/screens/help/Help.tscn +++ b/game/src/screens/help/Help.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://src/screens/help/Help.gd" type="Script" id=1] [ext_resource path="res://assets/paste.svg" type="Texture" id=2] [ext_resource path="res://assets/copy.svg" type="Texture" id=3] +[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=4] [sub_resource type="StyleBoxFlat" id=1] bg_color = Color( 0.960784, 0.94902, 0.301961, 1 ) @@ -16,6 +17,9 @@ anchor_right = 1.0 anchor_bottom = 1.0 script = ExtResource( 1 ) +[node name="FadeEffect" parent="." instance=ExtResource( 4 )] +node_path = NodePath("..") + [node name="VBoxContainer" type="VBoxContainer" parent="."] anchor_left = 0.5 anchor_top = 0.5 diff --git a/game/src/screens/info/Info.tscn b/game/src/screens/info/Info.tscn index 62b21fa..ab5f57d 100644 --- a/game/src/screens/info/Info.tscn +++ b/game/src/screens/info/Info.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://theme.tres" type="Theme" id=1] +[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=2] [ext_resource path="res://src/screens/info/Info.gd" type="Script" id=3] [sub_resource type="StyleBoxFlat" id=1] @@ -21,6 +22,9 @@ __meta__ = { "_edit_use_anchors_": true } +[node name="FadeEffect" parent="." instance=ExtResource( 2 )] +node_path = NodePath("..") + [node name="VBoxContainer" type="VBoxContainer" parent="."] anchor_left = 0.5 anchor_top = 0.5 diff --git a/game/src/screens/level-complete/LevelComplete.tscn b/game/src/screens/level-complete/LevelComplete.tscn index 9c75f3d..c398deb 100644 --- a/game/src/screens/level-complete/LevelComplete.tscn +++ b/game/src/screens/level-complete/LevelComplete.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://theme.tres" type="Theme" id=1] [ext_resource path="res://src/screens/level-complete/LevelComplete.gd" type="Script" id=2] [ext_resource path="res://assets/star.png" type="Texture" id=3] +[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=4] [node name="LevelComplete" type="Control"] pause_mode = 2 @@ -11,6 +12,9 @@ anchor_bottom = 1.0 theme = ExtResource( 1 ) script = ExtResource( 2 ) +[node name="FadeEffect" parent="." instance=ExtResource( 4 )] +node_path = NodePath("..") + [node name="VBoxContainer" type="VBoxContainer" parent="."] anchor_left = 0.5 anchor_top = 0.5 @@ -26,7 +30,6 @@ alignment = 1 margin_top = 65.0 margin_right = 475.0 margin_bottom = 183.0 -rect_scale = Vector2( 2, 2 ) rect_pivot_offset = Vector2( 237, 59 ) text = "12" align = 1 diff --git a/game/src/screens/level-select/LevelSelect.tscn b/game/src/screens/level-select/LevelSelect.tscn index eb0a0bb..0d8b694 100644 --- a/game/src/screens/level-select/LevelSelect.tscn +++ b/game/src/screens/level-select/LevelSelect.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://theme.tres" type="Theme" id=1] +[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=2] [ext_resource path="res://src/screens/level-select/LevelSelect.gd" type="Script" id=4] [node name="LevelSelect" type="Control"] @@ -10,6 +11,9 @@ anchor_bottom = 1.0 theme = ExtResource( 1 ) script = ExtResource( 4 ) +[node name="FadeEffect" parent="." instance=ExtResource( 2 )] +node_path = NodePath("..") + [node name="VBoxContainer" type="VBoxContainer" parent="."] anchor_left = 0.5 anchor_top = 0.5 diff --git a/game/src/screens/main/Main.gd b/game/src/screens/main/Main.gd index a335b6f..829a0fd 100644 --- a/game/src/screens/main/Main.gd +++ b/game/src/screens/main/Main.gd @@ -9,8 +9,6 @@ signal levels signal info signal help -onready var animation_player:AnimationPlayer = $AnimationPlayer - func _ready() -> void: $Buttons/Settings/MusicButton.pressed = Global.music $Buttons/Settings/SfxButton.pressed = Global.sfx @@ -27,7 +25,6 @@ func _on_InfoButton_pressed() -> void: func _on_Info_back() -> void: AudioMachine.click() - animation_player.play("InfoFadeOut") func _on_SimonDalvai_pressed() -> void: @@ -55,6 +52,6 @@ func _on_Help_pressed() -> void: emit_signal("help") - func _on_LevelControl_levels() -> void: emit_signal("levels") + diff --git a/game/src/screens/main/Main.tscn b/game/src/screens/main/Main.tscn index 0e0b96a..eedfd43 100644 --- a/game/src/screens/main/Main.tscn +++ b/game/src/screens/main/Main.tscn @@ -1,49 +1,19 @@ -[gd_scene load_steps=16 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://assets/font/manrope.thin.otf" type="DynamicFontData" id=1] [ext_resource path="res://theme.tres" type="Theme" id=2] [ext_resource path="res://assets/musicOff.png" type="Texture" id=3] [ext_resource path="res://src/screens/main/Main.gd" type="Script" id=4] -[ext_resource path="res://panel.tres" type="StyleBox" id=5] +[ext_resource path="res://styles/panel.tres" type="StyleBox" id=5] [ext_resource path="res://assets/github.svg" type="Texture" id=6] [ext_resource path="res://src/ui/level-control/LevelControl.tscn" type="PackedScene" id=7] [ext_resource path="res://assets/musicOn.png" type="Texture" id=8] [ext_resource path="res://src/ui/toggle-button/ToggleButton.tscn" type="PackedScene" id=9] +[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=10] [ext_resource path="res://assets/audioOn.png" type="Texture" id=11] [ext_resource path="res://assets/audioOff.png" type="Texture" id=12] [ext_resource path="res://assets/information.png" type="Texture" id=13] -[sub_resource type="Animation" id=3] -resource_name = "FirstFadeIn" -length = 1.2 -tracks/0/type = "value" -tracks/0/path = NodePath("Fade:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/keys = { -"times": PoolRealArray( 0, 0.4, 0.7, 1.2 ), -"transitions": PoolRealArray( 1, 1, 1, 1 ), -"update": 0, -"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 0 ) ] -} - -[sub_resource type="Animation" id=12] -length = 0.001 -tracks/0/type = "value" -tracks/0/path = NodePath("Fade:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/keys = { -"times": PoolRealArray( 0 ), -"transitions": PoolRealArray( 1 ), -"update": 0, -"values": [ Color( 1, 1, 1, 0 ) ] -} - [sub_resource type="DynamicFont" id=13] size = 53 outline_size = 3 @@ -60,20 +30,6 @@ rect_pivot_offset = Vector2( 360, 640 ) theme = ExtResource( 2 ) script = ExtResource( 4 ) -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -anims/FirstFadeIn = SubResource( 3 ) -anims/RESET = SubResource( 12 ) - -[node name="Fade" type="ColorRect" parent="."] -modulate = Color( 1, 1, 1, 0 ) -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 11.0 -margin_top = 19.0 -margin_right = 11.0 -margin_bottom = 19.0 -color = Color( 0.105882, 0.105882, 0.231373, 1 ) - [node name="Buttons" type="VBoxContainer" parent="."] anchor_left = 0.5 anchor_top = 0.5 @@ -204,6 +160,9 @@ size_flags_horizontal = 4 custom_fonts/font = SubResource( 13 ) text = "simondalvai.org" +[node name="FadeEffect" parent="." instance=ExtResource( 10 )] +node_path = NodePath("..") + [connection signal="levels" from="Buttons/LevelControl" to="." method="_on_LevelControl_levels"] [connection signal="pressed" from="Buttons/Play" to="." method="_on_Play_pressed"] [connection signal="pressed" from="Buttons/Help" to="." method="_on_Help_pressed"] diff --git a/game/src/screens/shop/Shop.tscn b/game/src/screens/shop/Shop.tscn index ffb5107..deea201 100644 --- a/game/src/screens/shop/Shop.tscn +++ b/game/src/screens/shop/Shop.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://theme.tres" type="Theme" id=1] [ext_resource path="res://src/screens/shop/Shop.gd" type="Script" id=2] +[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=3] [ext_resource path="res://assets/star.png" type="Texture" id=5] [node name="Shop" type="Control"] @@ -15,6 +16,9 @@ __meta__ = { "_edit_use_anchors_": true } +[node name="FadeEffect" parent="." instance=ExtResource( 3 )] +node_path = NodePath("..") + [node name="VBoxContainer" type="VBoxContainer" parent="."] anchor_left = 0.5 anchor_top = 0.568 diff --git a/game/button-transparent.tres b/game/styles/button-transparent.tres similarity index 100% rename from game/button-transparent.tres rename to game/styles/button-transparent.tres diff --git a/game/panel.tres b/game/styles/panel.tres similarity index 100% rename from game/panel.tres rename to game/styles/panel.tres diff --git a/game/theme.tres b/game/theme.tres index 0141092..625f61c 100644 --- a/game/theme.tres +++ b/game/theme.tres @@ -4,8 +4,8 @@ [ext_resource path="res://styles/button-pressed.tres" type="StyleBox" id=2] [ext_resource path="res://assets/font/manrope.thin.otf" type="DynamicFontData" id=3] [ext_resource path="res://styles/button-disabled.tres" type="StyleBox" id=4] -[ext_resource path="res://button-transparent.tres" type="StyleBox" id=5] -[ext_resource path="res://panel.tres" type="StyleBox" id=6] +[ext_resource path="res://styles/button-transparent.tres" type="StyleBox" id=5] +[ext_resource path="res://styles/panel.tres" type="StyleBox" id=6] [sub_resource type="DynamicFont" id=9] size = 85