Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在窗口中获得固定位置?我使用 2D 相机,如果移动,乐谱仍然在我身后。我试过了,但它不起作用:
spriteBatch.DrawString(font, "Score: "+ score,//here i have to put the parameters of the position , Color.Gold);
使用 2D 相机时,您需要SpriteBatch为固定图形使用另一个相机,否则您绘制的所有内容都会在屏幕上滑动。
SpriteBatch
spriteBatch.Begin(); spriteBatch.DrawString(font, "Score: "+ score, new Vector2(x, y), color); spriteBatch.End();