示例#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
文件: Mouse.cs 项目: Anttifer/Jypeli
        internal override MouseState GetState()
        {
#if WINDOWS_PHONE || ANDROID
            return(new MouseState());
#elif WINRT
            return(XnaMouse.GetState());
#else
            if (!IsCursorVisible)
            {
                // Reset the mouse to the center of the screen
                SetPosition(Vector.Zero);
            }

            return(XnaMouse.GetState());
#endif
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XnaInputDevices"/> class.
 /// </summary>
 public XnaInputDevices()
 {
     mKeyboard = new XnaKeyboard();
     mMouse = new XnaMouse();
 }
示例#4
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);
 }
示例#5
0
文件: Mouse.cs 项目: Anttifer/Jypeli
 internal Mouse(ScreenView screen)
 {
     this.screen       = screen;
     this.CurrentState = XnaMouse.GetState();
 }