mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 12:22:56 +08:00
Update to use virtual methods instead of reconstructing TextBuilder
This commit is contained in:
parent
cdb649476b
commit
39cf27637e
@ -5,7 +5,6 @@ using System.Threading.Tasks;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Text;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
@ -13,6 +12,10 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
private readonly LegacyGlyphStore glyphStore;
|
||||
|
||||
protected override char FixedWidthReferenceCharacter => '5';
|
||||
|
||||
protected override char[] FixedWidthExcludeCharacters => new[] { ',', '.', '%', 'x' };
|
||||
|
||||
public LegacySpriteText(ISkin skin, string font = "score")
|
||||
{
|
||||
Shadow = false;
|
||||
@ -22,8 +25,7 @@ namespace osu.Game.Skinning
|
||||
glyphStore = new LegacyGlyphStore(skin);
|
||||
}
|
||||
|
||||
protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) =>
|
||||
new TextBuilder(glyphStore, Font, MaxWidth, UseFullGlyphHeight, Vector2.Zero, Spacing, CharactersBacking, neverFixedWidthCharacters: new[] { ',', '.', '%', 'x' }, fixedWidthCalculationCharacter: '5');
|
||||
protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => base.CreateTextBuilder(glyphStore);
|
||||
|
||||
private class LegacyGlyphStore : ITexturedGlyphLookupStore
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user