1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-04 22:49:08 +01:00
MLEM/MLEM.Extended/Extensions/BitmapFontExtensions.cs

19 lines
729 B
C#
Raw Normal View History

2019-08-06 14:26:51 +02:00
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
2019-08-06 14:26:51 +02:00
using MonoGame.Extended.BitmapFonts;
namespace MLEM.Extended.Extensions {
public static class BitmapFontExtensions {
public static string SplitString(this BitmapFont font, string text, float width, float scale) {
return SpriteFontExtensions.SplitString(s => font.MeasureString(s).Width, text, width, scale);
2019-08-06 14:26:51 +02:00
}
2019-09-05 18:15:51 +02:00
public static string TruncateString(this BitmapFont font, string text, float width, float scale, bool fromBack = false) {
return SpriteFontExtensions.TruncateString(s => font.MeasureString(s).Width, text, width, scale, fromBack);
}
2019-08-06 14:26:51 +02:00
}
}