From 099354ac1acdb132f9aba80936e83d9f31ac3c7d Mon Sep 17 00:00:00 2001 From: Phawit Pornwattanakul Date: Fri, 16 Aug 2024 03:43:58 +0700 Subject: [PATCH] Add flash background animation to title --- .../Graphics/Screens/SongSelectionScreen.cs | 17 ++++++++++++++--- .../UserInterface/MenuTitleWithTexture.cs | 4 ++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Renako.Game/Graphics/Screens/SongSelectionScreen.cs b/Renako.Game/Graphics/Screens/SongSelectionScreen.cs index 865ec9b..83eafb0 100644 --- a/Renako.Game/Graphics/Screens/SongSelectionScreen.cs +++ b/Renako.Game/Graphics/Screens/SongSelectionScreen.cs @@ -2,6 +2,7 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; @@ -82,6 +83,10 @@ public partial class SongSelectionScreen : RenakoScreen private Container beatmapNoteCountContainer; private Box beatmapNoteCountBox; + private Box modeBackgroundBox; + private Box sourceBackgroundBox; + private Box songInfoBackgroundBox; + private Container idleRenakoLogoContainer; private RightBottomBeatmapSetDetailContainer rightBottomDetailsContainer; @@ -228,7 +233,7 @@ private void load(TextureStore textureStore, RenakoConfigManager config, AudioMa CornerRadius = 15, Children = new Drawable[] { - new Box() + modeBackgroundBox = new Box() { Colour = Color4Extensions.FromHex("E0BCD5"), RelativeSizeAxes = Axes.Both, @@ -270,7 +275,7 @@ private void load(TextureStore textureStore, RenakoConfigManager config, AudioMa CornerRadius = 15, Children = new Drawable[] { - new Box() + sourceBackgroundBox = new Box() { Colour = Color4Extensions.FromHex("E0BCD5"), RelativeSizeAxes = Axes.Both, @@ -322,7 +327,7 @@ private void load(TextureStore textureStore, RenakoConfigManager config, AudioMa CornerRadius = 15, Children = new Drawable[] { - new Box() + songInfoBackgroundBox = new Box() { Colour = Color4Extensions.FromHex("BEB6BA"), RelativeSizeAxes = Axes.Both, @@ -1176,6 +1181,12 @@ protected override void LoadComplete() Setting = RenakoSetting.PlayfieldBackgroundDim } ]; + + modeBackgroundBox.FlashColour(Color4Extensions.FromHex("f7f0f4"), 600, Easing.OutCirc).Delay(1000).Loop(); + songTitle.BackgroundBox.Delay(100).FlashColour(Color4Extensions.FromHex("f7f0f4"), 600, Easing.OutCirc).Delay(900).Loop(); + sourceBackgroundBox.Delay(200).FlashColour(Color4Extensions.FromHex("f7f0f4"), 600, Easing.OutCirc).Delay(800).Loop(); + songInfoBackgroundBox.Delay(300).FlashColour(Color4Extensions.FromHex("f7f0f4"), 600, Easing.OutCirc).Delay(700).Loop(); + beatmapInfoBox.Delay(400).FlashColour(Color4Extensions.FromHex("f7f0f4"), 600, Easing.OutCirc).Delay(600).Loop(); } protected override void Update() diff --git a/Renako.Game/Graphics/UserInterface/MenuTitleWithTexture.cs b/Renako.Game/Graphics/UserInterface/MenuTitleWithTexture.cs index f00ea2b..28271c3 100644 --- a/Renako.Game/Graphics/UserInterface/MenuTitleWithTexture.cs +++ b/Renako.Game/Graphics/UserInterface/MenuTitleWithTexture.cs @@ -25,7 +25,7 @@ public partial class MenuTitleWithTexture : CompositeDrawable public const float CONTAINER_PADDING = 20; - private Box backgroundBox; + public Box BackgroundBox; private SpriteText titleSpriteText; private SpriteText descriptionSpriteText; private Container textureContainer; @@ -65,7 +65,7 @@ private void load() Colour = Colour4.White; InternalChildren = new Drawable[] { - backgroundBox = new Box() + BackgroundBox = new Box() { Colour = BackgroundColor, RelativeSizeAxes = Axes.Both,