Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve slider ball and follow circle animations #14832

Closed
wants to merge 12 commits into from
Closed
4 changes: 0 additions & 4 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,9 @@ protected override void UpdateHitStateTransforms(ArmedState state)

const float fade_out_time = 450;

// intentionally pile on an extra FadeOut to make it happen much faster.
Ball.FadeOut(fade_out_time / 4, Easing.Out);

switch (state)
{
case ArmedState.Hit:
Ball.ScaleTo(HitObject.Scale * 1.4f, fade_out_time, Easing.Out);
if (SliderBody?.SnakingOut.Value == true)
Body.FadeOut(40); // short fade to allow for any body colour to smoothly disappear.
break;
Expand Down
19 changes: 16 additions & 3 deletions osu.Game.Rulesets.Osu/Skinning/Default/SliderBall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,22 @@ private set
tracking = value;

if (InputTracksVisualSize)
followCircle.ScaleTo(tracking ? 2.4f : 1f, 300, Easing.OutQuint);
{
if (tracking)
followCircle.ScaleTo(2f, 200, Easing.OutQuint);
goodtrailer marked this conversation as resolved.
Show resolved Hide resolved
else
followCircle.ScaleTo(1.6f, 200, Easing.None);
}
else
{
// We need to always be tracking the final size, at both endpoints. For now, this is achieved by removing the scale duration.
followCircle.ScaleTo(tracking ? 2.4f : 1f);
followCircle.ScaleTo(tracking ? 2f : 1f);
}

followCircle.FadeTo(tracking ? 1f : 0, 300, Easing.OutQuint);
goodtrailer marked this conversation as resolved.
Show resolved Hide resolved
if (tracking)
followCircle.FadeIn(100, Easing.OutQuint);
else
followCircle.FadeOut(200, Easing.InQuint);
}
}

Expand Down Expand Up @@ -205,6 +213,11 @@ public void UpdateProgress(double completionProgress)
ball.Rotation = -90 + (float)(-Math.Atan2(diff.X, diff.Y) * 180 / Math.PI);

lastPosition = newPos;

if (completionProgress >= 1f)
ball.FadeOut();
else
ball.FadeIn();
}

private class FollowCircleContainer : CircularContainer
Expand Down