// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; namespace osu.Game.Graphics.Sprites { public class OsuSpriteText : SpriteText { public const float FONT_SIZE = 16; public OsuSpriteText() { Shadow = true; TextSize = FONT_SIZE; } } public static class OsuSpriteTextTransformExtensions { /// /// Sets to a new value after a duration. /// /// A to which further transforms can be added. public static TransformSequence TransformTextTo(this T spriteText, string newText, double duration = 0, Easing easing = Easing.None) where T : OsuSpriteText => spriteText.TransformTo(nameof(OsuSpriteText.Text), newText, duration, easing); /// /// Sets to a new value after a duration. /// /// A to which further transforms can be added. public static TransformSequence TransformTextTo(this TransformSequence t, string newText, double duration = 0, Easing easing = Easing.None) where T : OsuSpriteText => t.Append(o => o.TransformTextTo(newText, duration, easing)); } }