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> </Start>
<End>~</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>
我看到一些其他職位,只需使用2D紋理和繪製,但只是沒有。那默認使用拉帶的全部目的。
嘗試添加TopBarFont.xnb到其中.SpriteFont –
MonoGame有一個內容創建工具相同的文件夾,你應該使用。 – robot9706