1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 04:22:54 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseTextAwesome.cs

54 lines
1.5 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2017-09-18 21:32:49 +08:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2017-10-24 00:08:53 +08:00
using osu.Framework.Graphics.Cursor;
2017-09-18 21:32:49 +08:00
using osu.Game.Graphics;
using OpenTK;
namespace osu.Game.Tests.Visual
{
2017-12-20 20:47:45 +08:00
public class TestCaseTextAwesome : OsuTestCase
2017-09-18 21:32:49 +08:00
{
public TestCaseTextAwesome()
{
FillFlowContainer flow;
2017-10-24 00:08:53 +08:00
Add(new ScrollContainer
2017-09-18 21:32:49 +08:00
{
RelativeSizeAxes = Axes.Both,
2017-10-24 00:08:53 +08:00
Child = flow = new FillFlowContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Full,
},
2017-09-18 21:32:49 +08:00
});
foreach (FontAwesome fa in Enum.GetValues(typeof(FontAwesome)))
2017-10-24 00:08:53 +08:00
flow.Add(new Icon(fa));
}
private class Icon : Container, IHasTooltip
{
public string TooltipText { get; }
public Icon(FontAwesome fa)
2017-09-18 21:32:49 +08:00
{
2017-10-24 00:08:53 +08:00
TooltipText = fa.ToString();
AutoSizeAxes = Axes.Both;
Child = new SpriteIcon
2017-09-18 21:32:49 +08:00
{
Icon = fa,
Size = new Vector2(60),
2017-10-24 00:08:53 +08:00
};
2017-09-18 21:32:49 +08:00
}
}
}
}