1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 21:17:18 +08:00

45 lines
1.3 KiB
C#
Raw Normal View History

// 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.
2018-04-13 18:19:50 +09:00
using osu.Framework.Bindables;
2018-04-13 18:19:50 +09:00
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
2019-04-02 14:51:28 +09:00
using osu.Framework.Graphics.Effects;
2018-04-13 18:19:50 +09:00
using osu.Framework.Graphics.Shapes;
2018-11-20 16:51:59 +09:00
using osuTK.Graphics;
2018-04-13 18:19:50 +09:00
2020-12-07 12:35:24 +09:00
namespace osu.Game.Rulesets.Catch.Skinning.Default
2018-04-13 18:19:50 +09:00
{
2022-11-24 14:32:20 +09:00
public partial class Pulp : Circle
2018-04-13 18:19:50 +09:00
{
public readonly Bindable<Color4> AccentColour = new Bindable<Color4>();
2018-04-13 18:19:50 +09:00
public Pulp()
{
RelativePositionAxes = Axes.Both;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
2019-08-21 13:29:50 +09:00
Blending = BlendingParameters.Additive;
2018-04-13 18:19:50 +09:00
Colour = Color4.White.Opacity(0.9f);
}
protected override void LoadComplete()
2018-04-13 18:19:50 +09:00
{
base.LoadComplete();
AccentColour.BindValueChanged(updateAccentColour, true);
2018-04-13 18:19:50 +09:00
}
private void updateAccentColour(ValueChangedEvent<Color4> colour)
{
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
2020-08-21 12:29:28 +09:00
Radius = DrawWidth / 2,
Colour = colour.NewValue.Darken(0.2f).Opacity(0.75f)
};
}
2018-04-13 18:19:50 +09:00
}
}