mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 12:53:11 +08:00
Basic logic
This commit is contained in:
parent
4930dfe87e
commit
6fa45aafc6
@ -14,13 +14,12 @@ using osu.Game.Beatmaps.IO;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
public class Intro : OsuScreen
|
public class Intro : OsuScreen
|
||||||
{
|
{
|
||||||
private readonly OsuLogo logo;
|
private readonly IntroSequence introSequence;
|
||||||
|
|
||||||
private const string menu_music_beatmap_hash = "715a09144f885d746644c1983e285044";
|
private const string menu_music_beatmap_hash = "715a09144f885d746644c1983e285044";
|
||||||
|
|
||||||
@ -46,18 +45,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
new ParallaxContainer
|
new ParallaxContainer
|
||||||
{
|
{
|
||||||
ParallaxAmount = 0.01f,
|
ParallaxAmount = 0.01f,
|
||||||
Children = new Drawable[]
|
Child = introSequence = new IntroSequence(),
|
||||||
{
|
|
||||||
logo = new OsuLogo
|
|
||||||
{
|
|
||||||
Alpha = 0,
|
|
||||||
Triangles = false,
|
|
||||||
Blending = BlendingMode.Additive,
|
|
||||||
Interactive = false,
|
|
||||||
Colour = Color4.DarkGray,
|
|
||||||
Ripple = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -122,14 +110,10 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
DidLoadMenu = true;
|
DidLoadMenu = true;
|
||||||
Push(mainMenu);
|
Push(mainMenu);
|
||||||
}, 2300);
|
}, 3200);
|
||||||
}, 600);
|
}, 600);
|
||||||
|
|
||||||
logo.ScaleTo(0.4f);
|
introSequence.Start();
|
||||||
logo.FadeOut();
|
|
||||||
|
|
||||||
logo.ScaleTo(1, 4400, Easing.OutQuint);
|
|
||||||
logo.FadeIn(20000, Easing.OutQuint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSuspending(Screen next)
|
protected override void OnSuspending(Screen next)
|
||||||
|
48
osu.Game/Screens/Menu/IntroSequence.cs
Normal file
48
osu.Game/Screens/Menu/IntroSequence.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
43
osu.Game/Tests/Visual/TestCaseIntro.cs
Normal file
43
osu.Game/Tests/Visual/TestCaseIntro.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -624,6 +624,7 @@
|
|||||||
<Compile Include="Screens\Menu\Disclaimer.cs" />
|
<Compile Include="Screens\Menu\Disclaimer.cs" />
|
||||||
<Compile Include="Screens\Menu\FlowContainerWithOrigin.cs" />
|
<Compile Include="Screens\Menu\FlowContainerWithOrigin.cs" />
|
||||||
<Compile Include="Screens\Menu\Intro.cs" />
|
<Compile Include="Screens\Menu\Intro.cs" />
|
||||||
|
<Compile Include="Screens\Menu\IntroSequence.cs" />
|
||||||
<Compile Include="Screens\Menu\LogoVisualisation.cs" />
|
<Compile Include="Screens\Menu\LogoVisualisation.cs" />
|
||||||
<Compile Include="Screens\Menu\MainMenu.cs" />
|
<Compile Include="Screens\Menu\MainMenu.cs" />
|
||||||
<Compile Include="Screens\Menu\MenuSideFlashes.cs" />
|
<Compile Include="Screens\Menu\MenuSideFlashes.cs" />
|
||||||
@ -746,6 +747,7 @@
|
|||||||
<Compile Include="Tests\Visual\TestCaseEditorSummaryTimeline.cs" />
|
<Compile Include="Tests\Visual\TestCaseEditorSummaryTimeline.cs" />
|
||||||
<Compile Include="Tests\Visual\TestCaseGamefield.cs" />
|
<Compile Include="Tests\Visual\TestCaseGamefield.cs" />
|
||||||
<Compile Include="Tests\Visual\TestCaseGraph.cs" />
|
<Compile Include="Tests\Visual\TestCaseGraph.cs" />
|
||||||
|
<Compile Include="Tests\Visual\TestCaseIntro.cs" />
|
||||||
<Compile Include="Tests\Visual\TestCaseKeyConfiguration.cs" />
|
<Compile Include="Tests\Visual\TestCaseKeyConfiguration.cs" />
|
||||||
<Compile Include="Tests\Visual\TestCaseKeyCounter.cs" />
|
<Compile Include="Tests\Visual\TestCaseKeyCounter.cs" />
|
||||||
<Compile Include="Tests\Visual\TestCaseLeaderboard.cs" />
|
<Compile Include="Tests\Visual\TestCaseLeaderboard.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user