diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 3aeef4bbc9..8be330bd32 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -14,13 +14,12 @@ using osu.Game.Beatmaps.IO; using osu.Game.Configuration; using osu.Game.Graphics.Containers; using osu.Game.Screens.Backgrounds; -using OpenTK.Graphics; namespace osu.Game.Screens.Menu { public class Intro : OsuScreen { - private readonly OsuLogo logo; + private readonly IntroSequence introSequence; private const string menu_music_beatmap_hash = "715a09144f885d746644c1983e285044"; @@ -46,18 +45,7 @@ namespace osu.Game.Screens.Menu new ParallaxContainer { ParallaxAmount = 0.01f, - Children = new Drawable[] - { - logo = new OsuLogo - { - Alpha = 0, - Triangles = false, - Blending = BlendingMode.Additive, - Interactive = false, - Colour = Color4.DarkGray, - Ripple = false - } - } + Child = introSequence = new IntroSequence(), } }; } @@ -122,14 +110,10 @@ namespace osu.Game.Screens.Menu { DidLoadMenu = true; Push(mainMenu); - }, 2300); + }, 3200); }, 600); - logo.ScaleTo(0.4f); - logo.FadeOut(); - - logo.ScaleTo(1, 4400, Easing.OutQuint); - logo.FadeIn(20000, Easing.OutQuint); + introSequence.Start(); } protected override void OnSuspending(Screen next) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs new file mode 100644 index 0000000000..c8a0d6f811 --- /dev/null +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Menu +{ + public class IntroSequence : Container + { + private OsuSpriteText welcomeText; + + public IntroSequence() + { + RelativeSizeAxes = Axes.Both; + Children = new Drawable[] + { + welcomeText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = "welcome", + Font = @"Exo2.0-Light", + TextSize = 50, + Alpha = 0, + } + }; + } + + public void Start() + { + welcomeText.FadeIn(1000); + welcomeText.TransformSpacingTo(new Vector2(20, 0), 3000, Easing.OutQuint); + } + + public void Restart() + { + FinishTransforms(true); + + welcomeText.Alpha = 0; + welcomeText.Spacing = Vector2.Zero; + + Start(); + } + } +} diff --git a/osu.Game/Tests/Visual/TestCaseIntro.cs b/osu.Game/Tests/Visual/TestCaseIntro.cs new file mode 100644 index 0000000000..3900afb1e7 --- /dev/null +++ b/osu.Game/Tests/Visual/TestCaseIntro.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Timing; +using osu.Game.Screens.Menu; + +namespace osu.Game.Tests.Visual +{ + internal class TestCaseIntro : OsuTestCase + { + private readonly IntroSequence intro; + + public TestCaseIntro() + { + var rateAdjustClock = new StopwatchClock(true); + var framedClock = new FramedClock(rateAdjustClock); + + framedClock.ProcessFrame(); + + Add(new Container + { + RelativeSizeAxes = Axes.Both, + Clock = framedClock, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + }, + intro = new IntroSequence(), + } + }); + + AddStep(@"Restart", intro.Restart); + AddSliderStep("Playback speed", 0.0, 2.0, 1, v => rateAdjustClock.Rate = v); + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c8e42a3ad3..f9c17a8cca 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -624,6 +624,7 @@ + @@ -746,6 +747,7 @@ +