osu/osu.Game/Screens/Play/FailDialog.cs

47 lines
1.4 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-01-20 07:51:43 +00:00
2017-02-17 09:59:30 +00:00
using osu.Framework.Screens;
2017-01-20 07:51:43 +00:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.Sprites;
2017-01-20 07:51:43 +00:00
using osu.Game.Modes;
using osu.Game.Screens.Backgrounds;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Screens.Play
{
2017-02-17 09:59:30 +00:00
class FailDialog : OsuScreen
2017-01-20 07:51:43 +00:00
{
2017-02-17 09:59:30 +00:00
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
2017-01-20 07:51:43 +00:00
2017-02-07 07:15:45 +00:00
private static readonly Vector2 background_blur = new Vector2(20);
2017-01-20 07:51:43 +00:00
public FailDialog()
{
Add(new OsuSpriteText
2017-01-20 07:51:43 +00:00
{
Text = "You failed!",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
TextSize = 50
});
}
2017-02-17 09:59:30 +00:00
protected override void OnEntering(Screen last)
2017-01-20 07:51:43 +00:00
{
base.OnEntering(last);
2017-02-17 09:59:30 +00:00
Background.Schedule(() => (Background as BackgroundScreenBeatmap)?.BlurTo(background_blur, 1000));
2017-01-20 07:51:43 +00:00
}
2017-02-17 09:59:30 +00:00
protected override bool OnExiting(Screen next)
2017-01-20 07:51:43 +00:00
{
Background.Schedule(() => Background.FadeColour(Color4.White, 500));
return base.OnExiting(next);
}
}
}