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