Add flash when activating the osu! logo.

This commit is contained in:
Dean Herbert 2017-01-27 13:50:22 +09:00
parent 50e4c39e32
commit 9b2669e1ae
1 changed files with 13 additions and 1 deletions

View File

@ -12,6 +12,7 @@
using osu.Framework.Graphics.Transformations;
using osu.Framework.Input;
using osu.Framework.MathUtils;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using OpenTK;
using OpenTK.Graphics;
@ -63,6 +64,7 @@ public bool Ripple
public bool Interactive = true;
private Box colourLayer;
private Box flashLayer;
public OsuLogo()
{
@ -112,7 +114,13 @@ public OsuLogo()
},
}
},
flashLayer = new Box
{
RelativeSizeAxes = Axes.Both,
BlendingMode = BlendingMode.Additive,
Colour = Color4.White,
Alpha = 0,
},
},
},
logo = new Sprite
@ -191,6 +199,10 @@ protected override bool OnClick(InputState state)
{
if (!Interactive) return false;
flashLayer.ClearTransformations();
flashLayer.Alpha = 0.4f;
flashLayer.FadeOut(1500, EasingTypes.OutExpo);
Action?.Invoke();
return true;
}