1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-20 00:12:57 +08:00
osu-lazer/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs

50 lines
1.4 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
2017-03-28 20:03:34 +08:00
using osu.Framework.Testing;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.MathUtils;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Desktop.VisualTests.Tests
{
2017-03-07 09:59:19 +08:00
internal class TestCaseTextAwesome : TestCase
{
public override string Description => @"Tests display of icons";
public TestCaseTextAwesome()
{
2017-03-02 02:33:01 +08:00
FillFlowContainer flow;
2017-03-07 09:59:19 +08:00
Add(flow = new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Size = new Vector2(0.5f),
Anchor = Anchor.Centre,
Origin = Anchor.Centre
});
int i = 50;
foreach (FontAwesome fa in Enum.GetValues(typeof(FontAwesome)))
{
flow.Add(new TextAwesome
{
Icon = fa,
TextSize = 60,
Colour = new Color4(
Math.Max(0.5f, RNG.NextSingle()),
Math.Max(0.5f, RNG.NextSingle()),
Math.Max(0.5f, RNG.NextSingle()),
1)
});
if (i-- == 0) break;
}
}
}
}