mirror of
https://github.com/SK-la/osu-framework.git
synced 2026-03-13 11:20:31 +00:00
58 lines
1.6 KiB
C#
58 lines
1.6 KiB
C#
// 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.Shapes;
|
|
using osu.Framework.Graphics.Sprites;
|
|
using osu.Framework.Testing;
|
|
using osuTK;
|
|
using osuTK.Graphics;
|
|
|
|
namespace osu.Framework.Tests.Visual
|
|
{
|
|
public class TestCaseSmoothedEdges : GridTestCase
|
|
{
|
|
public TestCaseSmoothedEdges() : base(2, 2)
|
|
{
|
|
Vector2[] smoothnesses =
|
|
{
|
|
new Vector2(0, 0),
|
|
new Vector2(0, 2),
|
|
new Vector2(1, 1),
|
|
new Vector2(2, 2),
|
|
};
|
|
|
|
for (int i = 0; i < Rows * Cols; ++i)
|
|
{
|
|
Cell(i).AddRange(new Drawable[]
|
|
{
|
|
new SpriteText
|
|
{
|
|
Text = $"{nameof(Sprite.EdgeSmoothness)}={smoothnesses[i]}",
|
|
TextSize = 20,
|
|
},
|
|
boxes[i] = new Box
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
Colour = Color4.White,
|
|
Anchor = Anchor.Centre,
|
|
Origin = Anchor.Centre,
|
|
Size = new Vector2(0.5f),
|
|
EdgeSmoothness = smoothnesses[i],
|
|
},
|
|
});
|
|
}
|
|
}
|
|
|
|
private readonly Box[] boxes = new Box[4];
|
|
|
|
protected override void Update()
|
|
{
|
|
base.Update();
|
|
|
|
foreach (Box box in boxes)
|
|
box.Rotation += 0.01f;
|
|
}
|
|
}
|
|
}
|