1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 04:49:40 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseLineBadge.cs
2019-05-13 00:36:05 +09:00

52 lines
1.8 KiB
C#

// 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;
using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
public class TestCaseLineBadge : OsuTestCase
{
public TestCaseLineBadge()
{
Container container;
LineBadge lineBadge;
Add(container = new Container
{
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());
AddSliderStep(@"Resize container", 1, 300, 150, value => container.ResizeTo(value));
AddStep(@"Horizontal", () => lineBadge.IsHorizontal = true);
AddStep(@"Anchor top", () => lineBadge.Anchor = Anchor.TopCentre);
AddStep(@"Vertical", () => lineBadge.IsHorizontal = false);
AddStep(@"Anchor left", () => lineBadge.Anchor = Anchor.CentreLeft);
}
}
}