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