2015-07-10 109 views
2
font = Content.Load<SpriteFont>("TopBarFont"); 

无论发生什么事情,或者我改变了什么,我都会得到这个错误。SpriteFont不能与MonoGame配合使用

An unhandled exception of type 'System.NotImplementedException' occurred in MonoGame.Framework.dll Additional information: The method or operation is not implemented. 

我TopBarFont.spritefont在设置为内容的内容文件夹,并始终复制到像我的所有其他资产的输出目录。

我SpriteFont类文件看起来像这样,

<?xml version="1.0" encoding="utf-8"?> 
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics"> 
    <Asset Type="Graphics:FontDescription"> 
     <FontName>Open Sans Light</FontName> 
     <Size>36</Size> 
     <Spacing>0</Spacing> 
     <UseKerning>true</UseKerning> 
     <Style>Regular</Style> 
     <CharacterRegions> 
      <CharacterRegion> 
       <Start>&#32;</Start> 
       <End>&#126;</End> 
      </CharacterRegion> 
     </CharacterRegions> 
    </Asset> 
</XnaContent> 

我看到一些其他职位,只需使用2D纹理和绘制,但只是没有。那默认使用拉带的全部目的。

+2

尝试添加TopBarFont.xnb到其中.SpriteFont –

+0

MonoGame有一个内容创建工具相同的文件夹,你应该使用。 – robot9706

回答

1

使用this转换器.SpriteFont转换成.xnb

+0

这是有点不幸,我们必须使用第三方工具,但没关系,它的工作原理。这就是重要的。谢谢。 – mistopportunity