mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 17:17:24 +08:00
Transition fixes and clock for VisualTest.
This commit is contained in:
parent
8e766a1f47
commit
b671a33911
@ -9,6 +9,8 @@ using System.Threading.Tasks;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.GameModes.Testing;
|
using osu.Framework.GameModes.Testing;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Framework.Timing;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Desktop.Tests
|
namespace osu.Desktop.Tests
|
||||||
{
|
{
|
||||||
@ -17,9 +19,19 @@ namespace osu.Desktop.Tests
|
|||||||
public override string Name => @"Music Controller";
|
public override string Name => @"Music Controller";
|
||||||
public override string Description => @"Tests music controller ui.";
|
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()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
ourClock.ProcessFrame();
|
||||||
MusicController mc = new MusicController
|
MusicController mc = new MusicController
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -28,5 +40,11 @@ namespace osu.Desktop.Tests
|
|||||||
Add(mc);
|
Add(mc);
|
||||||
AddToggle(@"Show", mc.ToggleVisibility);
|
AddToggle(@"Show", mc.ToggleVisibility);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
ourClock.ProcessFrame();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,21 +216,22 @@ namespace osu.Game.Overlays
|
|||||||
if (isNext == true)
|
if (isNext == true)
|
||||||
{
|
{
|
||||||
newBackground.Position = new Vector2(400, 0);
|
newBackground.Position = new Vector2(400, 0);
|
||||||
newBackground.MoveToX(0, 200, EasingTypes.Out);
|
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
|
||||||
backgroundSprite.MoveToX(-400, 200, EasingTypes.Out);
|
backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
|
||||||
backgroundSprite.Expire();
|
backgroundSprite.Expire();
|
||||||
}
|
}
|
||||||
else if (isNext == false)
|
else if (isNext == false)
|
||||||
{
|
{
|
||||||
newBackground.Position = new Vector2(-400, 0);
|
newBackground.Position = new Vector2(-400, 0);
|
||||||
newBackground.MoveToX(0, 200, EasingTypes.Out);
|
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
|
||||||
backgroundSprite.MoveToX(400, 200, EasingTypes.Out);
|
backgroundSprite.MoveToX(400, 500, EasingTypes.OutCubic);
|
||||||
backgroundSprite.Expire();
|
backgroundSprite.Expire();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Remove(backgroundSprite);
|
Remove(backgroundSprite);
|
||||||
}
|
}
|
||||||
|
backgroundSprite = newBackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Sprite getScaledSprite(Texture background)
|
private Sprite getScaledSprite(Texture background)
|
||||||
|
Loading…
Reference in New Issue
Block a user