SpriteFont渲染人工制品

时间:2016-03-01 02:51:26

标签: monogame

我尝试使用以下代码在MonoGame中渲染SpriteFont:

>>> self.text = (open("circles.dat", "r")).readlines()
>>> print self.text
['200 200 100\n', '75\t200\t15\n', '   325\t200\t15\n', '\n', '\t200\t\t75 10\n', '200 325 10\n']
>>>
>>> ans = map(lambda s: s.rstrip().replace("\t", " "), self.text)
>>> ans = " ".join(ans)
>>> ans = ans.split()
>>>
>>> final_ans = [int(a) for a in ans]
>>> final_ans = map(int, ans)  # alternative
>>> print final_ans
[200, 200, 100, 75, 200, 15, 325, 200, 15, 200, 75, 10, 200, 325, 10]

通过内容管理器将hudFont作为常规SpriteFont加载。当我在屏幕上呈现文本时,它看起来像这样:

Artefacts

我之前从未遇到过这个问题,并且因为可能导致此问题而感到茫然。有人有任何见解吗?

谢谢!

1 个答案:

答案 0 :(得分:2)

看起来我通过在MonoGame管道工具中将SpriteFont的 TextureFormat 设置更改为 NoChange 来解决问题。

不确定问题是什么;我以前从未遇到过使用默认设置的问题!