mirror of
https://github.com/ppy/osu
synced 2025-01-17 19:41:15 +00:00
Simplify animations
This commit is contained in:
parent
7c81f1e75b
commit
c3090dea5f
@ -214,23 +214,29 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
Size = entry.InitialSize;
|
Size = entry.InitialSize;
|
||||||
|
|
||||||
this.ScaleTo(entry.MaxSize, getAnimationTime() * 0.8f, Easing.OutSine)
|
//We want to fade to a darker colour to avoid colours such as white hiding the "ripple" effect.
|
||||||
|
var colourDarker = entry.Colour.Darken(0.1f);
|
||||||
|
|
||||||
|
this.ScaleTo(entry.MaxSize, getAnimationDuration() * 0.8f, Easing.OutSine)
|
||||||
.Then()
|
.Then()
|
||||||
.ScaleTo(entry.MaxSize * 1.5f, getAnimationTime() * 0.2f, Easing.OutSine)
|
.ScaleTo(entry.MaxSize * 1.5f, getAnimationDuration() * 0.2f, Easing.OutSine)
|
||||||
.FadeTo(0, getAnimationTime() * 0.2f, Easing.OutExpo);
|
.FadeTo(0, getAnimationDuration() * 0.2f, Easing.OutExpo);
|
||||||
|
|
||||||
colourBox.FadeColour(entry.IsHit ? entry.Colour : Colour4.Black, getAnimationTime() * 0.1f, Easing.OutSine)
|
innerCircle.ScaleTo(2f, getAnimationDuration() * 0.8f, Easing.OutCubic);
|
||||||
.Then()
|
|
||||||
.FadeColour(entry.IsHit ? entry.Colour.Darken(0.4f) : Colour4.Black, getAnimationTime() * 0.9f, Easing.OutSine);
|
|
||||||
|
|
||||||
innerCircle.FadeColour(entry.IsHit ? entry.Colour.Darken(0.2f) : Colour4.Black)
|
if (!entry.IsHit)
|
||||||
.FadeColour(entry.IsHit ? entry.Colour.Lighten(0.2f) : Colour4.Black, getAnimationTime());
|
{
|
||||||
|
colourBox.Colour = Colour4.Black;
|
||||||
|
innerCircle.Colour = Colour4.Black;
|
||||||
|
|
||||||
innerCircle.FadeTo(0.5f, getAnimationTime(), Easing.InExpo)
|
return;
|
||||||
.ScaleTo(2.2f, getAnimationTime(), Easing.InSine);
|
}
|
||||||
|
|
||||||
|
colourBox.FadeColour(colourDarker, getAnimationDuration() * 0.2f, Easing.OutQuint);
|
||||||
|
innerCircle.FadeColour(colourDarker);
|
||||||
|
|
||||||
// The absolute length of the bubble's animation, can be used in fractions for animations of partial length
|
// The absolute length of the bubble's animation, can be used in fractions for animations of partial length
|
||||||
double getAnimationTime() => 2000 + 450 / (450 / entry.FadeTime);
|
double getAnimationDuration() => 1700 + Math.Pow(entry.FadeTime, 1.15f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user