2022-11-16 19:53:55 +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 osuTK;
|
|
|
|
using osuTK.Graphics;
|
|
|
|
using osu.Game.Graphics.Backgrounds;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Background
|
|
|
|
{
|
|
|
|
public partial class TestSceneTrianglesV2Background : OsuTestScene
|
|
|
|
{
|
2022-11-16 20:17:50 +08:00
|
|
|
private readonly TrianglesV2 triangles;
|
|
|
|
|
2022-11-16 19:53:55 +08:00
|
|
|
public TestSceneTrianglesV2Background()
|
|
|
|
{
|
|
|
|
AddRange(new Drawable[]
|
|
|
|
{
|
|
|
|
new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Colour = Color4.Gray
|
|
|
|
},
|
|
|
|
new Container
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
2022-11-23 21:12:13 +08:00
|
|
|
Size = new Vector2(500, 100),
|
2022-11-16 19:53:55 +08:00
|
|
|
Masking = true,
|
|
|
|
CornerRadius = 40,
|
2022-11-23 21:12:13 +08:00
|
|
|
Children = new Drawable[]
|
2022-11-16 19:53:55 +08:00
|
|
|
{
|
2022-11-23 21:12:13 +08:00
|
|
|
new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Colour = Color4.Red
|
|
|
|
},
|
|
|
|
triangles = new TrianglesV2
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
ColourTop = Color4.White,
|
|
|
|
ColourBottom = Color4.Red
|
|
|
|
}
|
2022-11-16 19:53:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2022-11-16 20:17:50 +08:00
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
AddSliderStep("Spawn ratio", 0f, 2f, 1f, s => triangles.SpawnRatio = s);
|
2022-11-21 15:20:35 +08:00
|
|
|
AddSliderStep("Thickness", 0f, 1f, 0.02f, t => triangles.Thickness = t);
|
2022-11-16 20:17:50 +08:00
|
|
|
}
|
2022-11-16 19:53:55 +08:00
|
|
|
}
|
|
|
|
}
|