C# Class PantheonPrototype.ControlManager

This is the class that handles the input. It will keep track of all possible input devices and will return whether or not the button for a particular action (whatever button that is) is pushed.
Mostrar archivo Open project: Bacon41/PantheonPrototype Class Usage Examples

Public Properties

Property Type Description
actions ControlActions
gamepadControls GamePadControls
keyboardAndMouse MouseAndKeyboardControls

Public Methods

Method Description
ControlManager ( ) : System
Update ( ) : void
changeGamepadBindings ( ButtonState oldButton, Microsoft.Xna.Framework.Input.GamePadButtons newButton, GamePadState gamepad ) : void

This function will change the Control binding of a single button to another button on the gamepad.

changeKeyControlBindings ( Keys oldKey, Keys newKey, KeyboardState keyboard ) : void
disableControls ( bool mouse ) : void

Allows you to disable the controlls including or exluding the mouse click. True will allow the mouse click, false will disable the mouse click.

disableMotion ( ) : void
enableControls ( ) : void
enableMotion ( ) : void
updateMouse ( Microsoft.Xna.Framework.Input.MouseState mouse ) : void

This method was written to test the input information being received from the mouse, rather than testing within the code.

Private Methods

Method Description
reset ( ) : void

Resets all the thingies.

setDefaultGamepadControlScheme ( ) : void

Set the default button scheme for the XBOX360 gamepad controller

setDefaultMouseAndKeyboardControlScheme ( ) : void

Method Details

ControlManager() public method

public ControlManager ( ) : System
return System

Update() public method

public Update ( ) : void
return void

changeGamepadBindings() public method

This function will change the Control binding of a single button to another button on the gamepad.
public changeGamepadBindings ( ButtonState oldButton, Microsoft.Xna.Framework.Input.GamePadButtons newButton, GamePadState gamepad ) : void
oldButton ButtonState
newButton Microsoft.Xna.Framework.Input.GamePadButtons The button on the gamepad that the action will now be set to
gamepad Microsoft.Xna.Framework.Input.GamePadState The gamepadState that is already in place
return void

changeKeyControlBindings() public method

public changeKeyControlBindings ( Keys oldKey, Keys newKey, KeyboardState keyboard ) : void
oldKey Keys
newKey Keys
keyboard Microsoft.Xna.Framework.Input.KeyboardState
return void

disableControls() public method

Allows you to disable the controlls including or exluding the mouse click. True will allow the mouse click, false will disable the mouse click.
public disableControls ( bool mouse ) : void
mouse bool Whether or not the mouse click will be allowed
return void

disableMotion() public method

public disableMotion ( ) : void
return void

enableControls() public method

public enableControls ( ) : void
return void

enableMotion() public method

public enableMotion ( ) : void
return void

updateMouse() public method

This method was written to test the input information being received from the mouse, rather than testing within the code.
public updateMouse ( Microsoft.Xna.Framework.Input.MouseState mouse ) : void
mouse Microsoft.Xna.Framework.Input.MouseState MouseState from user's mouse
return void

Property Details

actions public_oe property

The current active actions from the player input.
public ControlActions,PantheonPrototype actions
return ControlActions

gamepadControls public_oe property

public GamePadControls,PantheonPrototype gamepadControls
return GamePadControls

keyboardAndMouse public_oe property

public MouseAndKeyboardControls,PantheonPrototype keyboardAndMouse
return MouseAndKeyboardControls