Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 我怎样才能得到窗口中的固定位置?_C#_Xna - Fatal编程技术网

C# 我怎样才能得到窗口中的固定位置?

C# 我怎样才能得到窗口中的固定位置?,c#,xna,C#,Xna,我怎样才能得到窗口中的固定位置?我使用2D相机,如果移动,分数仍在我身后。我试过这个,但它不起作用: spriteBatch.DrawString(font, "Score: "+ score,//here i have to put the parameters of the position , Color.Gold); 当使用2D相机时,您需要使用另一个SpriteBatch用于固定图形,否则您绘制的所有内容都将在屏幕上滑动 spriteBatch.Begin(); spriteBatc

我怎样才能得到窗口中的固定位置?我使用2D相机,如果移动,分数仍在我身后。我试过这个,但它不起作用:

spriteBatch.DrawString(font, "Score: "+ score,//here i have to put the parameters of the position , Color.Gold);

当使用2D相机时,您需要使用另一个
SpriteBatch
用于固定图形,否则您绘制的所有内容都将在屏幕上滑动

spriteBatch.Begin();
spriteBatch.DrawString(字体,“Score:+Score,新矢量2(x,y),颜色);
spriteBatch.End();

请尽量不要问同一个问题两次()。有人在30分钟内没有回答你的问题并不意味着你可以再问一次。