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.
Afficher le fichier Open project: Bacon41/PantheonPrototype Class Usage Examples

Méthodes publiques

Свойство Type Description
actions ControlActions
gamepadControls GamePadControls
keyboardAndMouse MouseAndKeyboardControls

Méthodes publiques

Méthode 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

Méthode 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 méthode

public ControlManager ( ) : System
Résultat System

Update() public méthode

public Update ( ) : void
Résultat void

changeGamepadBindings() public méthode

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
Résultat void

changeKeyControlBindings() public méthode

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

disableControls() public méthode

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
Résultat void

disableMotion() public méthode

public disableMotion ( ) : void
Résultat void

enableControls() public méthode

public enableControls ( ) : void
Résultat void

enableMotion() public méthode

public enableMotion ( ) : void
Résultat void

updateMouse() public méthode

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
Résultat void

Property Details

actions public_oe property

The current active actions from the player input.
public ControlActions,PantheonPrototype actions
Résultat ControlActions

gamepadControls public_oe property

public GamePadControls,PantheonPrototype gamepadControls
Résultat GamePadControls

keyboardAndMouse public_oe property

public MouseAndKeyboardControls,PantheonPrototype keyboardAndMouse
Résultat MouseAndKeyboardControls