MuScreenManager  1.0
MuScreenManager is an XNA class library that provides a screen management system, allowing for the simple integration of menus and other screens into your game.
 All Classes Namespaces Functions Variables Enumerations Properties
MuScreenManager.Input Class Reference

Provides an API for accessing input devices GamePad, Keyboard and Mouse More...

Public Member Functions

 Input ()
 Generate an instance of the Input class
 Input (int gamePadNum)
 Generate an instance of the Input class
void Update (GameTime gameTime)
 Update all the current states of the input devices, as well as keeping the previous states
Vector2 GetMousePosition ()
 Get the current position of the mouse
bool IsMouseIntersect (Rectangle checkRect)
 Check if the mouse is intersecting a rectangle at a certain location
bool IsLeftMouseDown ()
 Check if the left mouse button is down
bool IsLeftMouseUp ()
 Check if the left mouse button is up
bool IsLeftMousePressed ()
 Check if the left mouse button is pressed (Currently pressed but unpressed last update)
bool IsLeftMouseReleased ()
 Check if the left mouse button is released (Currently unpressed but pressed last update)
bool IsRightMouseDown ()
 Check if the right mouse button is down
bool IsRightMouseUp ()
 Check if the right mouse button is up
bool IsRightMousePressed ()
 Check if the right mouse button is pressed (Currently pressed but unpressed last update)
bool IsRightMouseReleased ()
 Check if the right mouse button is released (Currently unpressed but pressed last update)
bool IsKeyDown (Keys key)
 Check if a keyboard key is down
bool IsKeyUp (Keys key)
 Check if a keyboard key is up
bool IsKeyPressed (Keys key)
 Check if a keyboard key is pressed (Currently pressed but unpressed last update)
bool IsKeyReleased (Keys key)
 Check if a keyboard key is released (Currently unpressed but pressed last update)
Vector2 GetStickPosition (Stick stick, PlayerIndex playerNum)
 Get the current position of a joystick on the gamepad for a certain player
bool IsStickDown (Stick stick, Direction dir, PlayerIndex playerNum)
 Check if a stick on the gamepad is pressed down in a particular direction, similar to the DPad directional buttons
bool IsStickUp (Stick stick, Direction dir, PlayerIndex playerNum)
 Check if a stick on the gamepad is not pressed down in a particular direction, similar to the DPad directional buttons
bool IsStickPressed (Stick stick, Direction dir, PlayerIndex playerNum)
 Check if a stick on the gamepad is pressed in a particular direction, similar to the DPad directional buttons (Currently pressed but unpressed last update)
bool IsStickReleased (Stick stick, Direction dir, PlayerIndex playerNum)
 Check if a stick on the gamepad is released in a particular direction, similar to the DPad directional buttons (Currently unpressed but pressed last update)
bool IsButtonDown (Buttons button, PlayerIndex playerNum)
 Check if a button on the controller is down
bool IsButtonUp (Buttons button, PlayerIndex playerNum)
 Check if a button on the controller is up
bool IsButtonPressed (Buttons button, PlayerIndex playerNum)
 Check if a button on the controller is pressed (Currently pressed but unpressed last update)
bool IsButtonReleased (Buttons button, PlayerIndex playerNum)
 Check if a button on the controller is released (Currently unpressed but pressed last update)
bool IsGamepadConnected (PlayerIndex playerNum)
 Check if the gamepad of a certain player is connected

Properties

int NumOfGamepad [get]

Detailed Description

Provides an API for accessing input devices GamePad, Keyboard and Mouse

Constructor & Destructor Documentation

MuScreenManager.Input.Input ( )

Generate an instance of the Input class

MuScreenManager.Input.Input ( int  gamePadNum)

Generate an instance of the Input class

Parameters
gamePadNumNumber of gamepads to track (default 4)

Member Function Documentation

Vector2 MuScreenManager.Input.GetMousePosition ( )

Get the current position of the mouse

Returns
Current position of the mouse
Vector2 MuScreenManager.Input.GetStickPosition ( Stick  stick,
PlayerIndex  playerNum 
)

Get the current position of a joystick on the gamepad for a certain player

Parameters
stickStick to check
playerNumPlayer to be checked
Returns
Current position of the joystick inputted
bool MuScreenManager.Input.IsButtonDown ( Buttons  button,
PlayerIndex  playerNum 
)

Check if a button on the controller is down

Parameters
buttonButton to be checked
playerNumPlayer to be checked
Returns
Return if the button checked is down
bool MuScreenManager.Input.IsButtonPressed ( Buttons  button,
PlayerIndex  playerNum 
)

Check if a button on the controller is pressed (Currently pressed but unpressed last update)

Parameters
buttonButton to be checked
playerNumPlayer to be checked
Returns
Return if the button checked is pressed
bool MuScreenManager.Input.IsButtonReleased ( Buttons  button,
PlayerIndex  playerNum 
)

Check if a button on the controller is released (Currently unpressed but pressed last update)

Parameters
buttonButton to be checked
playerNumPlayer to be checked
Returns
Return if the button checked is released
bool MuScreenManager.Input.IsButtonUp ( Buttons  button,
PlayerIndex  playerNum 
)

Check if a button on the controller is up

Parameters
buttonButton to be checked
playerNumPlayer to be checked
Returns
Return if the button checked is up
bool MuScreenManager.Input.IsGamepadConnected ( PlayerIndex  playerNum)

Check if the gamepad of a certain player is connected

Parameters
playerNumPlayer to be checked
Returns
If the gamepad of a certain player is connected
bool MuScreenManager.Input.IsKeyDown ( Keys  key)

Check if a keyboard key is down

Returns
Return if a keyboard key is down
bool MuScreenManager.Input.IsKeyPressed ( Keys  key)

Check if a keyboard key is pressed (Currently pressed but unpressed last update)

Returns
Return if a keyboard key is pressed
bool MuScreenManager.Input.IsKeyReleased ( Keys  key)

Check if a keyboard key is released (Currently unpressed but pressed last update)

Returns
Return if a keyboard key is pressed
bool MuScreenManager.Input.IsKeyUp ( Keys  key)

Check if a keyboard key is up

Returns
Return if a keyboard key is up
bool MuScreenManager.Input.IsLeftMouseDown ( )

Check if the left mouse button is down

Returns
Return if the left mouse button is down
bool MuScreenManager.Input.IsLeftMousePressed ( )

Check if the left mouse button is pressed (Currently pressed but unpressed last update)

Returns
Return if the left mouse button is pressed
bool MuScreenManager.Input.IsLeftMouseReleased ( )

Check if the left mouse button is released (Currently unpressed but pressed last update)

Returns
Return if the left mouse button is released
bool MuScreenManager.Input.IsLeftMouseUp ( )

Check if the left mouse button is up

Returns
Return if the left mouse button is up
bool MuScreenManager.Input.IsMouseIntersect ( Rectangle  checkRect)

Check if the mouse is intersecting a rectangle at a certain location

Parameters
checkRectRectangle we are checking intersection with
Returns
Result from intersection check
bool MuScreenManager.Input.IsRightMouseDown ( )

Check if the right mouse button is down

Returns
Return if the right mouse button is down
bool MuScreenManager.Input.IsRightMousePressed ( )

Check if the right mouse button is pressed (Currently pressed but unpressed last update)

Returns
Return if the right mouse button is pressed
bool MuScreenManager.Input.IsRightMouseReleased ( )

Check if the right mouse button is released (Currently unpressed but pressed last update)

Returns
Return if the right mouse button is released
bool MuScreenManager.Input.IsRightMouseUp ( )

Check if the right mouse button is up

Returns
Return if the right mouse button is up
bool MuScreenManager.Input.IsStickDown ( Stick  stick,
Direction  dir,
PlayerIndex  playerNum 
)

Check if a stick on the gamepad is pressed down in a particular direction, similar to the DPad directional buttons

Parameters
dirDirection of the stick we are checking
playerNumPlayer to be checked
Returns
Return of the stick is pressed in thats direction or not
bool MuScreenManager.Input.IsStickPressed ( Stick  stick,
Direction  dir,
PlayerIndex  playerNum 
)

Check if a stick on the gamepad is pressed in a particular direction, similar to the DPad directional buttons (Currently pressed but unpressed last update)

Parameters
dirDirection of the stick we are checking
playerNumPlayer to be checked
Returns
Return of the stick is pressed in thats direction or not
bool MuScreenManager.Input.IsStickReleased ( Stick  stick,
Direction  dir,
PlayerIndex  playerNum 
)

Check if a stick on the gamepad is released in a particular direction, similar to the DPad directional buttons (Currently unpressed but pressed last update)

Parameters
dirDirection of the stick we are checking
playerNumPlayer to be checked
Returns
Return of the stick is released in thats direction or not
bool MuScreenManager.Input.IsStickUp ( Stick  stick,
Direction  dir,
PlayerIndex  playerNum 
)

Check if a stick on the gamepad is not pressed down in a particular direction, similar to the DPad directional buttons

Parameters
dirDirection of the stick we are checking
playerNumPlayer to be checked
Returns
Return of the stick is not pressed in thats direction or not
void MuScreenManager.Input.Update ( GameTime  gameTime)

Update all the current states of the input devices, as well as keeping the previous states

Parameters
gameTimeProvides a snapshot of the game time

The documentation for this class was generated from the following file: