2019-01-24 16:43:03 +08:00
|
|
|
|
// 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
|
|
|
|
|
|
2017-06-13 00:58:32 +08:00
|
|
|
|
using System;
|
2021-08-01 23:12:04 +08:00
|
|
|
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
2018-06-28 12:04:39 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-06-13 00:51:06 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-06-13 00:51:06 +08:00
|
|
|
|
namespace osu.Game.Graphics.Containers
|
|
|
|
|
{
|
2017-06-13 02:58:10 +08:00
|
|
|
|
public partial class OsuTextFlowContainer : TextFlowContainer
|
2017-06-13 00:51:06 +08:00
|
|
|
|
{
|
2019-02-28 12:31:40 +08:00
|
|
|
|
public OsuTextFlowContainer(Action<SpriteText> defaultCreationParameters = null)
|
|
|
|
|
: base(defaultCreationParameters)
|
2017-06-13 02:58:10 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-06-13 00:51:06 +08:00
|
|
|
|
protected override SpriteText CreateSpriteText() => new OsuSpriteText();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-08-01 23:12:04 +08:00
|
|
|
|
public ITextPart AddArbitraryDrawable(Drawable drawable) => AddPart(new TextPartManual(drawable.Yield()));
|
2018-06-28 12:04:39 +08:00
|
|
|
|
|
2021-08-01 23:12:04 +08:00
|
|
|
|
public ITextPart AddIcon(IconUsage icon, Action<SpriteText> creationParameters = null) => AddText(icon.Icon.ToString(), creationParameters);
|
2017-06-13 00:51:06 +08:00
|
|
|
|
}
|
|
|
|
|
}
|