2018-07-23 23:49:42 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2019-05-12 23:36:05 +08:00
|
|
|
|
using osuTK.Graphics;
|
2018-07-23 23:49:42 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
|
{
|
|
|
|
|
public class TestCaseLineBadge : OsuTestCase
|
|
|
|
|
{
|
|
|
|
|
public TestCaseLineBadge()
|
|
|
|
|
{
|
2018-07-24 00:38:20 +08:00
|
|
|
|
Container container;
|
2018-07-23 23:49:42 +08:00
|
|
|
|
LineBadge lineBadge;
|
|
|
|
|
|
2018-07-24 00:38:20 +08:00
|
|
|
|
Add(container = new Container
|
2018-07-23 23:49:42 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
Colour = Color4.Gray,
|
|
|
|
|
Alpha = 0.5f,
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
},
|
|
|
|
|
lineBadge = new LineBadge
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
UncollapsedSize = 10,
|
|
|
|
|
CollapsedSize = 2,
|
|
|
|
|
Colour = Color4.DeepSkyBlue,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AddStep(@"", () => { });
|
|
|
|
|
AddStep(@"Collapse", () => lineBadge.Collapse());
|
|
|
|
|
AddStep(@"Uncollapse", () => lineBadge.Uncollapse());
|
2018-07-24 00:38:20 +08:00
|
|
|
|
AddSliderStep(@"Resize container", 1, 300, 150, value => container.ResizeTo(value));
|
2018-07-23 23:49:42 +08:00
|
|
|
|
AddStep(@"Horizontal", () => lineBadge.IsHorizontal = true);
|
|
|
|
|
AddStep(@"Anchor top", () => lineBadge.Anchor = Anchor.TopCentre);
|
|
|
|
|
AddStep(@"Vertical", () => lineBadge.IsHorizontal = false);
|
|
|
|
|
AddStep(@"Anchor left", () => lineBadge.Anchor = Anchor.CentreLeft);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|