2022-11-15 07:54:37 +00: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.Game.Graphics.Backgrounds;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2023-01-25 09:20:51 +00:00
|
|
|
|
using osuTK;
|
2022-11-15 07:54:37 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Background
|
|
|
|
|
{
|
|
|
|
|
public partial class TestSceneTrianglesBackground : OsuTestScene
|
|
|
|
|
{
|
|
|
|
|
private readonly Triangles triangles;
|
|
|
|
|
|
|
|
|
|
public TestSceneTrianglesBackground()
|
|
|
|
|
{
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = Color4.Black
|
|
|
|
|
},
|
|
|
|
|
triangles = new Triangles
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
ColourLight = Color4.White,
|
2023-01-25 09:20:51 +00:00
|
|
|
|
ColourDark = Color4.Gray,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(0.9f)
|
2022-11-15 07:54:37 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
|
|
AddSliderStep("Triangle scale", 0f, 10f, 1f, s => triangles.TriangleScale = s);
|
2023-01-24 04:09:25 +00:00
|
|
|
|
AddSliderStep("Seed", 0, 1000, 0, s => triangles.Reset(s));
|
2023-01-25 09:20:51 +00:00
|
|
|
|
AddToggleStep("Masking", m => triangles.Masking = m);
|
2022-11-15 07:54:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|