2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-02-07 12:59:30 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2017-02-07 12:52:19 +08:00
|
|
|
|
|
2017-06-12 15:40:53 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using OpenTK;
|
2016-11-04 10:43:00 +08:00
|
|
|
|
|
2017-02-07 12:52:19 +08:00
|
|
|
|
namespace osu.Game.Graphics.UserInterface
|
|
|
|
|
{
|
2017-06-12 15:40:53 +08:00
|
|
|
|
public class LoadingAnimation : VisibilityContainer
|
2017-02-07 12:52:19 +08:00
|
|
|
|
{
|
2017-08-03 13:36:21 +08:00
|
|
|
|
private readonly SpriteIcon spinner;
|
2017-06-12 15:40:53 +08:00
|
|
|
|
|
2017-02-07 12:52:19 +08:00
|
|
|
|
public LoadingAnimation()
|
|
|
|
|
{
|
2017-06-12 15:40:53 +08:00
|
|
|
|
Size = new Vector2(20);
|
|
|
|
|
|
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2017-08-03 13:36:21 +08:00
|
|
|
|
spinner = new SpriteIcon
|
2017-06-12 15:40:53 +08:00
|
|
|
|
{
|
2017-08-03 13:36:21 +08:00
|
|
|
|
Size = new Vector2(20),
|
2017-06-12 15:40:53 +08:00
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Icon = FontAwesome.fa_spinner
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
2017-07-22 00:23:01 +08:00
|
|
|
|
spinner.Spin(2000, RotationDirection.Clockwise);
|
2017-02-07 12:52:19 +08:00
|
|
|
|
}
|
2017-06-12 15:40:53 +08:00
|
|
|
|
|
|
|
|
|
private const float transition_duration = 500;
|
|
|
|
|
|
2017-07-23 02:50:25 +08:00
|
|
|
|
protected override void PopIn() => this.FadeIn(transition_duration * 5, Easing.OutQuint);
|
2017-06-12 15:40:53 +08:00
|
|
|
|
|
2017-07-23 02:50:25 +08:00
|
|
|
|
protected override void PopOut() => this.FadeOut(transition_duration, Easing.OutQuint);
|
2017-02-07 12:52:19 +08:00
|
|
|
|
}
|
2017-06-12 15:40:53 +08:00
|
|
|
|
}
|