/// <summary> /// Smoothly adjusts <see cref="IFillFlowContainer.Spacing"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> TransformSpacingTo <T, TEasing>(this TransformSequence <T> t, Vector2 newSpacing, double duration, TEasing easing) where T : class, IFillFlowContainer where TEasing : IEasingFunction => t.Append(o => o.TransformSpacingTo(newSpacing, duration, easing));
/// <summary> /// Smoothly adjusts <see cref="Drawable.Height"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> ResizeHeightTo <T>(this TransformSequence <T> t, float newHeight, double duration = 0, Easing easing = Easing.None) where T : Drawable => t.Append(o => o.ResizeHeightTo(newHeight, duration, easing));
/// <summary> /// Smoothly adjusts <see cref="Drawable.Y"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> MoveToY <T>(this TransformSequence <T> t, float destination, double duration = 0, Easing easing = Easing.None) where T : Drawable => t.Append(o => o.MoveToY(destination, duration, easing));
/// <summary> /// Instantaneously flashes <see cref="Drawable.Colour"/>, then smoothly changes it back over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> FlashColour <T>(this TransformSequence <T> t, ColourInfo flashColour, double duration, Easing easing = Easing.None) where T : Drawable => t.Append(o => o.FlashColour(flashColour, duration, easing));
public static TransformSequence <T> FadeAccent <T>(this TransformSequence <T> t, Color4 newColour, double duration = 0, Easing easing = Easing.None) where T : Drawable, IHasAccentColour => t.Append(o => o.FadeAccent(newColour, duration, easing));
public static TransformSequence <T> Schedule <T>(this TransformSequence <T> t, Action scheduledAction, out ScheduledDelegate scheduledDelegate) where T : Drawable => t.Append(o => o.Schedule(scheduledAction), out scheduledDelegate);
public static TransformSequence <T> Spin <T>(this TransformSequence <T> t, double revolutionDuration, RotationDirection direction, float startRotation, int numRevolutions) where T : Drawable => t.Loop(0, numRevolutions, d => d.RotateTo(startRotation).RotateTo(startRotation + (direction == RotationDirection.Clockwise ? 360 : -360), revolutionDuration));
/// <summary> /// Smoothly adjusts the value of a <see cref="Bindable{TValue}"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> TransformBindableTo <T, TValue>(this TransformSequence <T> t, [NotNull] Bindable <TValue> bindable, TValue newValue, double duration = 0, Easing easing = Easing.None, InterpolationFunc <TValue> interpolationFunc = null) where T : class, ITransformable => t.Append(o => o.TransformBindableTo(bindable, newValue, duration, easing, interpolationFunc));
public static TransformSequence <CircularProgress> FillTo(this TransformSequence <CircularProgress> t, double newValue, double duration = 0, Easing easing = Easing.None) => t.FillTo(newValue, duration, new DefaultEasingFunction(easing));
/// <summary> /// Instantaneously flashes <see cref="Drawable.Colour"/>, then smoothly changes it back over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> FlashColour <T>(this TransformSequence <T> t, ColourInfo flashColour, double duration, Easing easing = Easing.None) where T : Drawable => t.FlashColour(flashColour, duration, new DefaultEasingFunction(easing));
public static TransformSequence <T> Expire <T>(this TransformSequence <T> t, bool calculateLifetimeStart = false) where T : Drawable => t.Append(o => o.Expire(calculateLifetimeStart));
/// <summary> /// Smoothly adjusts <see cref="Drawable.Alpha"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> FadeTo <T>(this TransformSequence <T> t, float newAlpha, double duration = 0, Easing easing = Easing.None) where T : Drawable => t.FadeTo(newAlpha, duration, new DefaultEasingFunction(easing));
/// <summary> /// Smoothly adjusts <see cref="Drawable.Alpha"/> from 1 to 0 over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> FadeOutFromOne <T>(this TransformSequence <T> t, double duration = 0, Easing easing = Easing.None) where T : Drawable => t.FadeOutFromOne(duration, new DefaultEasingFunction(easing));
/// <summary> /// Smoothly adjusts the value of a <see cref="Bindable{TValue}"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> TransformBindableTo <T, TValue, TEasing>(this TransformSequence <T> t, [NotNull] Bindable <TValue> bindable, TValue newValue, double duration, TEasing easing) where T : class, ITransformable where TEasing : IEasingFunction => t.Append(o => o.TransformBindableTo(bindable, newValue, duration, easing));
/// <summary> /// Smoothly adjusts <see cref="IContainer.RelativeChildOffset"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> TransformRelativeChildOffsetTo <T>(this TransformSequence <T> t, Vector2 newOffset, double duration = 0, Easing easing = Easing.None) where T : IContainer => t.Append(o => o.TransformRelativeChildOffsetTo(newOffset, duration, easing));
public static TransformSequence <CircularProgress> FillTo <TEasing>(this TransformSequence <CircularProgress> t, double newValue, double duration, TEasing easing) where TEasing : IEasingFunction => t.Append(cp => cp.FillTo(newValue, duration, easing));
/// <summary> /// Smoothly adjusts <see cref="IBufferedContainer.BlurSigma"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> BlurTo <T>(this TransformSequence <T> t, Vector2 newBlurSigma, double duration = 0, Easing easing = Easing.None) where T : IBufferedContainer => t.Append(o => o.BlurTo(newBlurSigma, duration, easing));
/// <summary> /// Sets <see cref="OsuSpriteText.Text"/> to a new value after a duration. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> TransformTextTo <T>(this TransformSequence <T> t, string newText, double duration = 0, Easing easing = Easing.None) where T : OsuSpriteText => t.Append(o => o.TransformTextTo(newText, duration, easing));
/// <summary> /// Smoothly adjusts <see cref="IFillFlowContainer.Spacing"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> TransformSpacingTo <T>(this TransformSequence <T> t, Vector2 newSpacing, double duration = 0, Easing easing = Easing.None) where T : IFillFlowContainer => t.Append(o => o.TransformSpacingTo(newSpacing, duration, easing));
public static TransformSequence <CircularProgress> FillTo(this TransformSequence <CircularProgress> t, double newValue, double duration = 0, Easing easing = Easing.None) => t.Append(cp => cp.TransformBindableTo(cp.Current, newValue, duration, easing));
/// <summary> /// Smoothly adjusts <see cref="Drawable.Alpha"/> from 1 to 0 over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> FadeOutFromOne <T>(this TransformSequence <T> t, double duration = 0, Easing easing = Easing.None) where T : Drawable => t.Append(o => o.FadeOutFromOne(duration, easing));
/// <summary> /// Smoothly adjusts <see cref="Drawable.Position"/> by an offset to its final value over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> MoveToOffset <T>(this TransformSequence <T> t, Vector2 offset, double duration = 0, Easing easing = Easing.None) where T : Drawable => t.Append(o => o.MoveToOffset(offset, duration, easing));
private void pushWhenLoaded() { if (!this.IsCurrentScreen()) { return; } if (!readyForPush) { // as the pushDebounce below has a delay, we need to keep checking and cancel a future debounce // if we become unready for push during the delay. cancelLoad(); return; } // if a push has already been scheduled, no further action is required. // this value is reset via cancelLoad() to allow a second usage of the same PlayerLoader screen. if (scheduledPushPlayer != null) { return; } scheduledPushPlayer = Scheduler.AddDelayed(() => { // ensure that once we have reached this "point of no return", readyForPush will be false for all future checks (until a new player instance is prepared). var consumedPlayer = consumePlayer(); contentOut(); TransformSequence <PlayerLoader> pushSequence = this.Delay(250); // only show if the warning was created (i.e. the beatmap needs it) // and this is not a restart of the map (the warning expires after first load). if (epilepsyWarning?.IsAlive == true) { const double epilepsy_display_length = 3000; pushSequence .Schedule(() => epilepsyWarning.State.Value = Visibility.Visible) .TransformBindableTo(volumeAdjustment, 0.25, EpilepsyWarning.FADE_DURATION, Easing.OutQuint) .Delay(epilepsy_display_length) .Schedule(() => { epilepsyWarning.Hide(); epilepsyWarning.Expire(); }) .Delay(EpilepsyWarning.FADE_DURATION); } pushSequence.Schedule(() => { if (!this.IsCurrentScreen()) { return; } LoadTask = null; // By default, we want to load the player and never be returned to. // Note that this may change if the player we load requested a re-run. ValidForResume = false; if (consumedPlayer.LoadedBeatmapSuccessfully) { this.Push(consumedPlayer); } else { this.Exit(); } }); }, 500); }
public static TransformSequence <T> Schedule <T>(this TransformSequence <T> t, Action scheduledAction) where T : Drawable => t.Append(o => o.Schedule(scheduledAction));
/// <summary> /// Smoothly adjusts <see cref="Drawable.Scale"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> ScaleTo <T>(this TransformSequence <T> t, float newScale, double duration = 0, Easing easing = Easing.None) where T : Drawable => t.Append(o => o.ScaleTo(newScale, duration, easing));
/// <summary> /// Smoothly adjusts the alpha channel of the colour of <see cref="IContainer.EdgeEffect"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> FadeEdgeEffectTo <T>(this TransformSequence <T> t, float newAlpha, double duration, Easing easing = Easing.None) where T : IContainer => t.Append(o => o.FadeEdgeEffectTo(newAlpha, duration, easing));
/// <summary> /// Smoothly adjusts <see cref="Drawable.Position"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> MoveTo <T>(this TransformSequence <T> t, Vector2 newPosition, double duration = 0, Easing easing = Easing.None) where T : Drawable => t.Append(o => o.MoveTo(newPosition, duration, easing));
/// <summary> /// Smoothly adjusts the colour of <see cref="IContainer.EdgeEffect"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> FadeEdgeEffectTo <T>(this TransformSequence <T> t, Color4 newColour, double duration = 0, Easing easing = Easing.None) where T : IContainer => t.Append(o => o.FadeEdgeEffectTo(newColour, duration, easing));
public static TransformSequence <T> Expire <T>(this TransformSequence <T> t) where T : Drawable => t.Append(o => o.Expire());
/// <summary> /// Smoothly adjusts <see cref="IBufferedContainer.BlurSigma"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public static TransformSequence <T> BlurTo <T, TEasing>(this TransformSequence <T> t, Vector2 newBlurSigma, double duration, TEasing easing) where T : class, IBufferedContainer where TEasing : IEasingFunction => t.Append(o => o.BlurTo(newBlurSigma, duration, easing));