2015-07-10 104 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