1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 14:07:24 +08:00
osu-lazer/osu.Game/Graphics/UserInterface/DimmedLoadingLayer.cs

45 lines
1.2 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Graphics.UserInterface
{
2019-08-04 18:54:23 +08:00
public class DimmedLoadingLayer : VisibilityContainer
{
private const float transition_duration = 250;
private readonly LoadingAnimation loading;
2019-08-04 18:54:23 +08:00
public DimmedLoadingLayer()
{
RelativeSizeAxes = Axes.Both;
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0.5f),
},
loading = new LoadingAnimation(),
};
}
protected override void PopIn()
{
this.FadeIn(transition_duration, Easing.OutQuint);
loading.Show();
}
protected override void PopOut()
{
this.FadeOut(transition_duration, Easing.OutQuint);
loading.Hide();
}
}
}