1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 22:22:54 +08:00
osu-lazer/osu.Game.Rulesets.Mania/UI/HitExplosion.cs

67 lines
2.0 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2017-09-11 14:24:28 +08:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics;
2017-09-11 12:44:39 +08:00
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Mania.Objects.Drawables;
2017-09-11 12:44:39 +08:00
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Mania.UI
{
internal class HitExplosion : CompositeDrawable
{
private readonly Box inner;
public HitExplosion(DrawableHitObject judgedObject)
2017-09-11 12:44:39 +08:00
{
bool isTick = judgedObject is DrawableHoldNoteTick;
2017-09-11 12:44:39 +08:00
Anchor = Anchor.TopCentre;
Origin = Anchor.Centre;
RelativeSizeAxes = Axes.Both;
Size = new Vector2(isTick ? 0.5f : 1);
2017-09-11 12:44:39 +08:00
FillMode = FillMode.Fit;
2017-09-11 14:43:23 +08:00
Blending = BlendingMode.Additive;
2017-09-11 12:44:39 +08:00
Color4 accent = isTick ? Color4.White : judgedObject.AccentColour;
2017-09-11 12:44:39 +08:00
InternalChild = new CircularContainer
{
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = 1,
BorderColour = accent,
2017-09-11 12:44:39 +08:00
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
Colour = accent,
2017-09-11 12:44:39 +08:00
Radius = 10,
Hollow = true
},
Child = inner = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = accent,
2017-09-11 12:44:39 +08:00
Alpha = 1,
AlwaysPresent = true,
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
this.ScaleTo(2f, 600, Easing.OutQuint).FadeOut(500);
2017-09-11 12:44:39 +08:00
inner.FadeOut(250);
Expire(true);
2017-09-11 12:44:39 +08:00
}
}
}