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