1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-26 10:12:54 +08:00
osu-lazer/osu.Game.Rulesets.Catch/Skinning/Default/FruitPiece.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.5 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.
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Objects;
2020-12-07 11:35:24 +08:00
namespace osu.Game.Rulesets.Catch.Skinning.Default
{
internal partial class FruitPiece : CatchHitObjectPiece
{
/// <summary>
/// Because we're adding a border around the fruit, we need to scale down some.
/// </summary>
public const float RADIUS_ADJUST = 1.1f;
public readonly Bindable<FruitVisualRepresentation> VisualRepresentation = new Bindable<FruitVisualRepresentation>();
protected override Drawable BorderPiece { get; }
2022-10-26 15:08:01 +08:00
protected override Drawable HyperBorderPiece { get; }
public FruitPiece()
{
RelativeSizeAxes = Axes.Both;
2022-10-26 15:08:01 +08:00
InternalChildren = new[]
{
new FruitPulpFormation
{
AccentColour = { BindTarget = AccentColour },
VisualRepresentation = { BindTarget = VisualRepresentation }
},
BorderPiece = new BorderPiece(),
HyperBorderPiece = new HyperBorderPiece()
};
}
protected override void LoadComplete()
{
base.LoadComplete();
IndexInBeatmap.BindValueChanged(index =>
{
VisualRepresentation.Value = Fruit.GetVisualRepresentation(index.NewValue);
}, true);
}
}
}