MouseState.X Property

Specifies the horizontal position of the mouse cursor.

Bb200107.note(en-us,XNAGameStudio.41).gifXbox 360 Specific Information
The value of this property is always 0.

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

Syntax

public int X { get; }

Property Value

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

Remarks

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.

See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone