【发布时间】:2015-07-10 00:50:34
【问题描述】:
font = Content.Load<SpriteFont>("TopBarFont");
无论出于何种原因,无论发生什么或我更改了什么,我总是会收到此错误。
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 纹理并绘制它,但没有。这默认使用 DrawString 的全部目的。
【问题讨论】:
-
尝试将 TopBarFont.xnb 添加到 .SpriteFont 所在的同一文件夹中
-
MonoGame 有一个内容构建工具,你应该使用它。
标签: c# xna xna-4.0 monogame spritefont