1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00
osu-lazer/osu.Game/Graphics/Sprites/TruncatingSpriteText.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
694 B
C#
Raw Normal View History

2023-06-09 08:11:17 +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.
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
2023-06-09 08:11:17 +08:00
using osu.Framework.Localisation;
namespace osu.Game.Graphics.Sprites
{
public sealed partial class TruncatingSpriteText : OsuSpriteText, IHasTooltip
{
public bool ShowTooltip { get; init; } = true;
2023-06-09 08:11:17 +08:00
public LocalisableString TooltipText => Text;
public override bool HandlePositionalInput => IsTruncated && ShowTooltip;
2023-06-09 08:11:17 +08:00
public TruncatingSpriteText()
{
((SpriteText)this).Truncate = true;
2023-06-09 08:11:17 +08:00
}
}
}