MouseState Constructor

Initializes a new instance of the MouseState class.

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

public MouseState (
         int x,
         int y,
         int scrollWheel,
         ButtonState leftButton,
         ButtonState middleButton,
         ButtonState rightButton,
         ButtonState xButton1,
         ButtonState xButton2
)

Parameters

x
Type: Int32
Horizontal mouse position.
y
Type: Int32
Vertical mouse position.
scrollWheel
Type: Int32
Mouse scroll wheel value.
leftButton
Type: ButtonState
Left mouse button state.
middleButton
Type: ButtonState
Middle mouse button state.
rightButton
Type: ButtonState
Right mouse button state.
xButton1
Type: ButtonState
XBUTTON1 state.
xButton2
Type: ButtonState
XBUTTON2 state.

Games normally use GetState to get the true mouse state. This constructor is used instead to simulate mouse input for passing within the game's own input subsystem.

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

Community Additions

ADD
Show: