1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 07:53:38 +08:00
osu-lazer/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs

29 lines
1007 B
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
2018-04-13 17:19:50 +08:00
using System;
using osu.Framework.Extensions.IEnumerableExtensions;
2018-06-28 12:04:39 +08:00
using osu.Framework.Graphics;
2018-04-13 17:19:50 +08:00
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics.Containers
{
2022-11-24 13:32:20 +08:00
public partial class OsuTextFlowContainer : TextFlowContainer
2018-04-13 17:19:50 +08:00
{
2019-02-28 12:31:40 +08:00
public OsuTextFlowContainer(Action<SpriteText> defaultCreationParameters = null)
: base(defaultCreationParameters)
2018-04-13 17:19:50 +08:00
{
}
protected override SpriteText CreateSpriteText() => new OsuSpriteText();
public ITextPart AddArbitraryDrawable(Drawable drawable) => AddPart(new TextPartManual(drawable.Yield()));
2018-06-28 12:04:39 +08:00
public ITextPart AddIcon(IconUsage icon, Action<SpriteText> creationParameters = null) => AddText(icon.Icon.ToString(), creationParameters);
2018-04-13 17:19:50 +08:00
}
}