Mouse

class Mouse : System.Object

Allows reading position and button click information from mouse.

System.IntPtr WindowHandle

Gets or sets the window handle for current mouse processing.

public MouseState GetState(GameWindow window)

This API is an extension to XNA. Gets mouse state information that includes position and button presses for the provided window

Parameters:
  • window (Microsoft.Xna.Framework.GameWindow) –
Returns:

Current state of the mouse.

public MouseState GetState()

Gets mouse state information that includes position and button presses for the primary window

Returns:Current state of the mouse.
public void SetPosition(int x, int y)

Sets mouse cursor’s relative position to game-window.

Parameters:
  • x (int) – Relative horizontal position of the cursor.
  • y (int) – Relative vertical position of the cursor.
public void SetCursor(MouseCursor cursor)

Sets the cursor image to the specified MouseCursor.

Parameters:
  • cursor (Microsoft.Xna.Framework.Input.MouseCursor) – Mouse cursor to use for the cursor image.
public void PlatformSetCursor(MouseCursor cursor)
Parameters:
  • cursor (Microsoft.Xna.Framework.Input.MouseCursor) –