Created
September 27, 2016 04:24
-
-
Save peppy/4c8213b181cf7107c8155e1bfdbc62d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2007-2016 ppy Pty Ltd <[email protected]>. | |
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE | |
using OpenTK.Graphics; | |
using osu.Framework.GameModes.Testing; | |
using osu.Framework.Graphics; | |
using osu.Framework.Graphics.Containers; | |
using osu.Framework.Graphics.Drawables; | |
using osu.Framework.Graphics.Sprites; | |
namespace osu.Framework.VisualTests.Tests | |
{ | |
class TestCaseSpriteText : TestCase | |
{ | |
public override string Name => @"SpriteText"; | |
public override string Description => @"Test all sizes of text rendering"; | |
public override void Reset() | |
{ | |
base.Reset(); | |
FlowContainer flow; | |
Children = new Drawable[] | |
{ | |
new ScrollContainer | |
{ | |
Children = new Drawable[] | |
{ | |
new Box { Colour = Color4.White, SizeMode = InheritMode.XY }, | |
flow = new FlowContainer | |
{ | |
Anchor = Anchor.TopLeft, | |
Direction = FlowDirection.VerticalOnly, | |
} | |
} | |
} | |
}; | |
for (int i = 1; i <= 200; i++) | |
{ | |
SpriteText text = new SpriteText | |
{ | |
Text = $@"Font testy at size {i}", | |
Colour = new Color4(230,230,230,255), | |
TextSize = i | |
}; | |
flow.Add(text); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment