From 581ec765fb07d99e2f38ca18eb6d4e7885d2f13a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Feb 2017 12:51:56 +0900 Subject: [PATCH] Improve transitions of MusicController. --- osu.Game/Overlays/MusicController.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 521cddd7e2..eaf40294a5 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) transition_length7-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -85,6 +85,8 @@ namespace osu.Game.Overlays { dragContainer = new Container { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, Masking = true, CornerRadius = 5, EdgeEffect = new EdgeEffect @@ -374,10 +376,19 @@ namespace osu.Game.Overlays base.Dispose(isDisposing); } - //placeholder for toggling - protected override void PopIn() => FadeIn(100); + const float transition_length = 800; - protected override void PopOut() => FadeOut(100); + protected override void PopIn() + { + FadeIn(transition_length, EasingTypes.OutQuint); + dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic); + } + + protected override void PopOut() + { + FadeOut(transition_length, EasingTypes.OutQuint); + dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint); + } private enum TransformDirection { None, Next, Prev }