C# Class PG515.Input.InputManager

Implements the IInputService interface and the GameComponent class. For information about functions, read comments in IInputService.
Inheritance: Microsoft.Xna.Framework.GameComponent, IInputService
Show file Open project: Westerdals/PG2200LectureCode2013 Class Usage Examples

Public Methods

Method Description
InputManager ( Microsoft.Xna.Framework.Game game ) : System
IsButtonDown ( Buttons button, PlayerIndex playerIndex ) : bool
IsButtonDown ( Buttons button, int playerIndex ) : bool

Same as IsButtonDown(Buttons, playerIndex), uses the int(-1) directly (faster than playerIndex)

IsButtonDown ( MouseButtons button ) : bool
IsButtonPressed ( Buttons button, PlayerIndex playerIndex ) : bool
IsButtonPressed ( Buttons button, int playerIndex ) : bool

Same as IsButtonPressed(Buttons, playerIndex), uses the int(-1) directly (faster than playerIndex)

IsButtonPressed ( MouseButtons button ) : bool
IsButtonReleased ( MouseButtons button ) : bool
IsButtonUp ( Buttons button, PlayerIndex playerIndex ) : bool
IsButtonUp ( Buttons button, int playerIndex ) : bool

Same as IsButtonUp(Buttons, playerIndex), uses the int(-1) directly (faster than playerIndex)

IsButtonUp ( MouseButtons button ) : bool
IsKeyDown ( Keys key ) : bool
IsKeyPressed ( Keys key ) : bool
IsKeyReleased ( Keys key ) : bool
IsKeyUp ( Keys key ) : bool
Update ( GameTime gameTime ) : void

Method Details

InputManager() public method

public InputManager ( Microsoft.Xna.Framework.Game game ) : System
game Microsoft.Xna.Framework.Game
return System

IsButtonDown() public method

public IsButtonDown ( Buttons button, PlayerIndex playerIndex ) : bool
button Buttons
playerIndex PlayerIndex
return bool

IsButtonDown() public method

Same as IsButtonDown(Buttons, playerIndex), uses the int(-1) directly (faster than playerIndex)
public IsButtonDown ( Buttons button, int playerIndex ) : bool
button Buttons the button to check
playerIndex int Index of the player (1-4)
return bool

IsButtonDown() public method

public IsButtonDown ( MouseButtons button ) : bool
button MouseButtons
return bool

IsButtonPressed() public method

public IsButtonPressed ( Buttons button, PlayerIndex playerIndex ) : bool
button Buttons
playerIndex PlayerIndex
return bool

IsButtonPressed() public method

Same as IsButtonPressed(Buttons, playerIndex), uses the int(-1) directly (faster than playerIndex)
public IsButtonPressed ( Buttons button, int playerIndex ) : bool
button Buttons the button to check
playerIndex int Index of the player (1-4)
return bool

IsButtonPressed() public method

public IsButtonPressed ( MouseButtons button ) : bool
button MouseButtons
return bool

IsButtonReleased() public method

public IsButtonReleased ( MouseButtons button ) : bool
button MouseButtons
return bool

IsButtonUp() public method

public IsButtonUp ( Buttons button, PlayerIndex playerIndex ) : bool
button Buttons
playerIndex PlayerIndex
return bool

IsButtonUp() public method

Same as IsButtonUp(Buttons, playerIndex), uses the int(-1) directly (faster than playerIndex)
public IsButtonUp ( Buttons button, int playerIndex ) : bool
button Buttons the button to check
playerIndex int Index of the player (1-4)
return bool

IsButtonUp() public method

public IsButtonUp ( MouseButtons button ) : bool
button MouseButtons
return bool

IsKeyDown() public method

public IsKeyDown ( Keys key ) : bool
key Keys
return bool

IsKeyPressed() public method

public IsKeyPressed ( Keys key ) : bool
key Keys
return bool

IsKeyReleased() public method

public IsKeyReleased ( Keys key ) : bool
key Keys
return bool

IsKeyUp() public method

public IsKeyUp ( Keys key ) : bool
key Keys
return bool

Update() public method

public Update ( GameTime gameTime ) : void
gameTime GameTime
return void