mirror of
https://github.com/ppy/osu.git
synced 2024-11-18 13:33:22 +08:00
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
#nullable disable
|
|
|
|
using osu.Framework.Bindables;
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Effects;
|
|
using osu.Framework.Graphics.Shapes;
|
|
using osuTK.Graphics;
|
|
|
|
namespace osu.Game.Rulesets.Catch.Skinning.Default
|
|
{
|
|
public class Pulp : Circle
|
|
{
|
|
public readonly Bindable<Color4> AccentColour = new Bindable<Color4>();
|
|
|
|
public Pulp()
|
|
{
|
|
RelativePositionAxes = Axes.Both;
|
|
Anchor = Anchor.Centre;
|
|
Origin = Anchor.Centre;
|
|
|
|
Blending = BlendingParameters.Additive;
|
|
Colour = Color4.White.Opacity(0.9f);
|
|
}
|
|
|
|
protected override void LoadComplete()
|
|
{
|
|
base.LoadComplete();
|
|
|
|
AccentColour.BindValueChanged(updateAccentColour, true);
|
|
}
|
|
|
|
private void updateAccentColour(ValueChangedEvent<Color4> colour)
|
|
{
|
|
EdgeEffect = new EdgeEffectParameters
|
|
{
|
|
Type = EdgeEffectType.Glow,
|
|
Radius = DrawWidth / 2,
|
|
Colour = colour.NewValue.Darken(0.2f).Opacity(0.75f)
|
|
};
|
|
}
|
|
}
|
|
}
|