A game framework written with osu! in mind.
at master 61 lines 1.9 kB view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using osu.Framework.Graphics; 5using osu.Framework.Graphics.Containers; 6using osu.Framework.Graphics.Sprites; 7 8namespace osu.Framework.Tests.Visual.Sprites 9{ 10 public class TestSceneSpriteText : FrameworkTestScene 11 { 12 public TestSceneSpriteText() 13 { 14 FillFlowContainer flow; 15 16 Children = new Drawable[] 17 { 18 new BasicScrollContainer 19 { 20 RelativeSizeAxes = Axes.Both, 21 Children = new[] 22 { 23 flow = new FillFlowContainer 24 { 25 Anchor = Anchor.TopLeft, 26 AutoSizeAxes = Axes.Y, 27 RelativeSizeAxes = Axes.X, 28 Direction = FillDirection.Vertical, 29 } 30 } 31 } 32 }; 33 34 flow.Add(new SpriteText 35 { 36 Text = @"the quick red fox jumps over the lazy brown dog" 37 }); 38 flow.Add(new SpriteText 39 { 40 Text = @"THE QUICK RED FOX JUMPS OVER THE LAZY BROWN DOG" 41 }); 42 flow.Add(new SpriteText 43 { 44 Text = @"0123456789!@#$%^&*()_-+-[]{}.,<>;'\" 45 }); 46 47 for (int i = 1; i <= 200; i++) 48 { 49 SpriteText text = new SpriteText 50 { 51 Text = $@"Font testy at size {i}", 52 Font = new FontUsage("Roboto", i, i % 4 > 1 ? "Bold" : "Regular", i % 2 == 1), 53 AllowMultiline = true, 54 RelativeSizeAxes = Axes.X, 55 }; 56 57 flow.Add(text); 58 } 59 } 60 } 61}