MouseState.X Property

Specifies the horizontal position of the mouse cursor.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public int X { get; }

Property Value

Horizontal position of the mouse cursor in relation to the upper-left corner of the game window.

If the mouse is to the left of the client area (the inside portion of the game window, excluding the borders), the returned coordinate is negative. If the mouse is to the right of the client area, the returned coordinate is greater than the window's client area width.

Xbox 360, Windows XP SP2, Windows Vista

Community Additions