Ejemplo n.º 1
0
 public MonoGameGameFont(MonoGameFileHandle fntFileHandle, MonoGameFileHandle textureFileHandle)
 {
     _fontName              = fntFileHandle.nameWithoutExtension();
     _spriteFont            = BMFontLoader.LoadXml(fntFileHandle.readString(), ((MonoGameTexture)Mdx.graphics.newTexture(textureFileHandle)).texture2D);
     _sharedFontGlyphLayout = newGlyphLayout();
     _capHeight             = _spriteFont.MeasureString("A").Y;
 }
Ejemplo n.º 2
0
 public bool loadInternal()
 {
     _fontName              = _fileHandle.nameWithoutExtension();
     _spriteFont            = _fileHandle.loadFromContentManager <SpriteFont>();
     _sharedFontGlyphLayout = newGlyphLayout();
     _capHeight             = _spriteFont.MeasureString("A").Y;
     return(true);
 }
Ejemplo n.º 3
0
 public MonoGameGameFont(MonoGameFileHandle ttfFileHandle, int size)
 {
     _fontName   = ttfFileHandle.nameWithoutExtension();
     _spriteFont = TtfFontBaker.Bake(ttfFileHandle.readBytes(),
                                     size,
                                     1024,
                                     1024,
                                     new[]
     {
         CharacterRange.BasicLatin,
         CharacterRange.Latin1Supplement,
         CharacterRange.LatinExtendedA,
         CharacterRange.Cyrillic
     }
                                     ).CreateSpriteFont(((MonoGameGraphics)Mdx.graphicsContext)._graphicsDevice);
     _sharedFontGlyphLayout = newGlyphLayout();
     _capHeight             = _spriteFont.MeasureString("A").Y;
 }