private void Main_Step()
{
MouseState mouseState = Mouse.GetState();
double x_pixel, y_pixel;
device.Clear(Color.CornflowerBlue);
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
spriteBatch.DrawString(testFont, "(" + mouseState.X + ", " + mouseState.Y, new Vector2(500, 50), Color.Yellow);
spriteBatch.End();
}
每当我执行 XNA 程序时,即使我什么都不移动鼠标,鼠标坐标 X、Y 也在不断变化。我认为它应该被修复,因为我没有移动鼠标。
这个问题使鼠标事件变得困难。
有什么问题?我的屏幕分辨率是 1920 x 1080。