1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseIntroSequence.cs

53 lines
1.5 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2017-10-26 19:42:23 +08:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-11-01 16:07:03 +08:00
using System;
using System.Collections.Generic;
2017-10-26 19:42:23 +08:00
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
{
2017-11-03 16:54:35 +08:00
public class TestCaseIntroSequence : OsuTestCase
2017-10-26 19:42:23 +08:00
{
2017-11-01 16:07:03 +08:00
public override IReadOnlyList<Type> RequiredTypes => new[]
{
2017-11-03 16:54:35 +08:00
typeof(OsuLogo),
2017-11-01 16:07:03 +08:00
};
2017-11-03 16:54:35 +08:00
public TestCaseIntroSequence()
2017-10-26 19:42:23 +08:00
{
2017-11-03 16:54:35 +08:00
OsuLogo logo;
2017-10-26 19:42:23 +08:00
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,
},
2017-11-03 16:54:35 +08:00
logo = new OsuLogo
{
Anchor = Anchor.Centre,
}
2017-10-26 19:42:23 +08:00
}
});
2017-11-03 16:54:35 +08:00
AddStep(@"Restart", logo.PlayIntro);
2017-10-26 19:42:23 +08:00
AddSliderStep("Playback speed", 0.0, 2.0, 1, v => rateAdjustClock.Rate = v);
}
}
}