1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:52:55 +08:00

Move the FollowCircle border to its own container

This commit is contained in:
tgi74000 2018-07-30 10:52:37 +02:00
parent 84135c49ca
commit c6aabc6d2d

View File

@ -35,6 +35,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private readonly Slider slider; private readonly Slider slider;
public readonly Drawable FollowCircle; public readonly Drawable FollowCircle;
private Drawable fadeFollowCircle;
private Drawable drawableBall; private Drawable drawableBall;
public SliderBall(Slider slider) public SliderBall(Slider slider)
@ -44,23 +45,29 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Blending = BlendingMode.Additive; Blending = BlendingMode.Additive;
Origin = Anchor.Centre; Origin = Anchor.Centre;
BorderThickness = 10;
BorderColour = Color4.Orange;
Children = new[] Children = new[]
{ {
FollowCircle = new Container FollowCircle = new Container
{ {
Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new Box
{
Colour = Color4.Orange,
RelativeSizeAxes = Axes.Both,
}),
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Width = width, Width = width,
Height = width, Height = width,
Alpha = 0, Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new CircularContainer
{
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = 5,
BorderColour = Color4.Orange,
Blending = BlendingMode.Additive,
Child = fadeFollowCircle = new Box
{
Colour = Color4.Orange,
RelativeSizeAxes = Axes.Both,
Alpha = 0,
}
}),
}, },
new CircularContainer new CircularContainer
{ {
@ -134,7 +141,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
tracking = value; tracking = value;
FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint);
FollowCircle.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); fadeFollowCircle?.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint);
} }
} }