MonoGame 3.5.1中Mouse.GetState()存在BUG,获取的坐标点始终是0,可以用TouchPanel暂时解决
MonoGame 3.5.1 Mouse.GetState()存在Bug,获取的坐标点始终是0.在官方修复之前可以用TouchPanel暂时解决。当然只在iOS,android,WP,UWP等带触摸屏幕的设备上有效。UWP例外
var touches = TouchPanel.GetState(); if (touches.Count > 0) { ms = new MouseState((int)touches[0].Position.X, (int)touches[0].Position.Y, 0, ButtonState.Pressed, ButtonState.Released, ButtonState.Released, ButtonState.Released, ButtonState.Released); } else { ms = Mouse.GetState(); }