示例#1
0
文件: Mouse.cs 项目: Anttifer/Jypeli
        private void SetPosition(Vector pos)
        {
#if !WINRT && !WINDOWS_PHONE
            // Not supported on WinRT... only sets xna coords
            Vector screenpos = pos.Transform(screen.GetScreenInverse());
            XnaV2  center    = ScreenView.ToXnaCoords(screenpos, screen.ViewportSize, Vector.Zero);
            XnaMouse.SetPosition((int)center.X, (int)center.Y);
#endif
        }
示例#2
0
 /// <summary>
 /// Sets the position of the mouse
 /// </summary>
 /// <param name="position">The new position of the mouse</param>
 public static void SetPosition(Vector2 position)
 {
     XnaMouse.SetPosition((int)position.X, (int)position.Y);
 }