1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Transition fixes and clock for VisualTest.

This commit is contained in:
Huo Yaoyuan 2016-10-24 18:18:54 +08:00
parent 8e766a1f47
commit b671a33911
2 changed files with 23 additions and 4 deletions

View File

@ -9,6 +9,8 @@ using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.GameModes.Testing;
using osu.Game.Overlays;
using osu.Framework.Timing;
using osu.Framework;
namespace osu.Desktop.Tests
{
@ -17,9 +19,19 @@ namespace osu.Desktop.Tests
public override string Name => @"Music Controller";
public override string Description => @"Tests music controller ui.";
IFrameBasedClock ourClock;
protected override IFrameBasedClock Clock => ourClock;
public override void Load(BaseGame game)
{
base.Load(game);
ourClock = new FramedClock();
}
public override void Reset()
{
base.Reset();
ourClock.ProcessFrame();
MusicController mc = new MusicController
{
Origin = Anchor.Centre,
@ -28,5 +40,11 @@ namespace osu.Desktop.Tests
Add(mc);
AddToggle(@"Show", mc.ToggleVisibility);
}
protected override void Update()
{
base.Update();
ourClock.ProcessFrame();
}
}
}

View File

@ -216,21 +216,22 @@ namespace osu.Game.Overlays
if (isNext == true)
{
newBackground.Position = new Vector2(400, 0);
newBackground.MoveToX(0, 200, EasingTypes.Out);
backgroundSprite.MoveToX(-400, 200, EasingTypes.Out);
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
backgroundSprite.Expire();
}
else if (isNext == false)
{
newBackground.Position = new Vector2(-400, 0);
newBackground.MoveToX(0, 200, EasingTypes.Out);
backgroundSprite.MoveToX(400, 200, EasingTypes.Out);
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
backgroundSprite.MoveToX(400, 500, EasingTypes.OutCubic);
backgroundSprite.Expire();
}
else
{
Remove(backgroundSprite);
}
backgroundSprite = newBackground;
}
private Sprite getScaledSprite(Texture background)