1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 11:27:24 +08:00

Added flash when clicking a PauseButton

This commit is contained in:
DrabWeb 2017-01-31 08:07:05 -04:00
parent fe09bab78f
commit bf54ae86ea

View File

@ -65,6 +65,7 @@ namespace osu.Game.Overlays.Pause
{
didClick = true;
colourContainer.ResizeTo(new Vector2(1.5f, 1f), clickDuration, EasingTypes.In);
flash();
SampleClick?.Play();
Action?.Invoke();
@ -101,6 +102,22 @@ namespace osu.Game.Overlays.Pause
didClick = false;
}
private void flash()
{
var flash = new Box
{
RelativeSizeAxes = Axes.Both
};
colourContainer.Add(flash);
flash.Colour = ButtonColour;
flash.BlendingMode = BlendingMode.Additive;
flash.Alpha = 0.3f;
flash.FadeOutFromOne(clickDuration);
flash.Expire();
}
private void reapplyGlow()
{
if (leftGlow == null || centerGlow == null || rightGlow == null) return;