如何使用 XNA 在窗口中获得固定位置? [英] How can i get a fixed position in a window with XNA?
本文介绍了如何使用 XNA 在窗口中获得固定位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须在我的游戏中显示我的分数,但我使用 2D 摄像头,当我移动时,书写分数"仍然在我的播放器后面.我试过这个,但它不起作用 ofcr:
I have to show my score in my game but I use 2D camera and when I move the writing "score" remains behind my player. I tried this but it doesn't function ofcr:
spriteBatch.DrawString(font, "Score: "+ score, /*param of the position */, Color.Gold);
推荐答案
我没有正确理解您的问题,但是:使用 SpriteSortMode.BackToFront
并将您的文本呈现为最后一项.
I don't understand your problem correctly but:
Use SpriteSortMode.BackToFront
and render your text as last item.
这篇关于如何使用 XNA 在窗口中获得固定位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文