1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-10 14:07:18 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseTextAwesome.cs

56 lines
1.5 KiB
C#
Raw Normal View History

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