mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 17:43:12 +08:00
Add transform test for fun
This commit is contained in:
parent
d2df09432f
commit
28e2b6cec7
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
@ -44,6 +45,31 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSpectrum()
|
||||||
|
{
|
||||||
|
StarRatingDisplay starRating = null;
|
||||||
|
|
||||||
|
BindableDouble starRatingNumeric;
|
||||||
|
|
||||||
|
AddStep("load display", () =>
|
||||||
|
{
|
||||||
|
Child = starRating = new StarRatingDisplay(new StarDifficulty(5.55, 1))
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Scale = new Vector2(3f),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("transform over spectrum", () =>
|
||||||
|
{
|
||||||
|
starRatingNumeric = new BindableDouble();
|
||||||
|
starRatingNumeric.BindValueChanged(val => starRating.Current.Value = new StarDifficulty(val.NewValue, 1));
|
||||||
|
this.TransformBindableTo(starRatingNumeric, 10, 10000, Easing.OutQuint);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestChangingStarRatingDisplay()
|
public void TestChangingStarRatingDisplay()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user