1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 06:07:25 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseLineBadge.cs

52 lines
1.8 KiB
C#
Raw Normal View History

2019-05-13 16:14:52 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
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;
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);
}
}
}