1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-07 04:43:21 +08:00

Add Fade-In effect to Swell object

This commit is contained in:
Anthony 2025-01-29 03:53:14 +01:00
parent a863230983
commit a5b4abda88

View File

@ -35,6 +35,15 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
/// </summary> /// </summary>
private const double ring_appear_offset = 100; private const double ring_appear_offset = 100;
/// <summary>
/// Offset away from the start time of the swell at which the Fade-In effect starts.
/// </summary>
private const double fade_in_offset = 1800;
/// <summary>
/// Duration of the Fade-In time of the swell.
/// </summary>
private const double fade_in_duration = 666;
private Vector2 baseSize; private Vector2 baseSize;
private readonly Container<DrawableSwellTick> ticks; private readonly Container<DrawableSwellTick> ticks;
@ -248,10 +257,20 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
} }
} }
protected override void UpdateInitialTransforms()
{
// allow for the fade-in effect
Alpha = 0;
}
protected override void UpdateStartTimeStateTransforms() protected override void UpdateStartTimeStateTransforms()
{ {
base.UpdateStartTimeStateTransforms(); base.UpdateStartTimeStateTransforms();
// swell fade-in effect from stable
using (BeginDelayedSequence(-fade_in_offset))
this.FadeIn(fade_in_duration, Easing.In);
using (BeginDelayedSequence(-ring_appear_offset)) using (BeginDelayedSequence(-ring_appear_offset))
targetRing.ScaleTo(target_ring_scale, 400, Easing.OutQuint); targetRing.ScaleTo(target_ring_scale, 400, Easing.OutQuint);
} }