C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
actions ControlActions
gamepadControls GamePadControls
keyboardAndMouse MouseAndKeyboardControls

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
reset ( ) : void

Resets all the thingies.

setDefaultGamepadControlScheme ( ) : void

Set the default button scheme for the XBOX360 gamepad controller

setDefaultMouseAndKeyboardControlScheme ( ) : void

Описание методов

ControlManager() публичный Метод

public ControlManager ( ) : System
Результат System

Update() публичный Метод

public Update ( ) : void
Результат void

changeGamepadBindings() публичный Метод

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
Результат void

changeKeyControlBindings() публичный Метод

public changeKeyControlBindings ( Keys oldKey, Keys newKey, KeyboardState keyboard ) : void
oldKey Keys
newKey Keys
keyboard Microsoft.Xna.Framework.Input.KeyboardState
Результат void

disableControls() публичный Метод

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
Результат void

disableMotion() публичный Метод

public disableMotion ( ) : void
Результат void

enableControls() публичный Метод

public enableControls ( ) : void
Результат void

enableMotion() публичный Метод

public enableMotion ( ) : void
Результат void

updateMouse() публичный Метод

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
Результат void

Описание свойств

actions публичное свойство

The current active actions from the player input.
public ControlActions,PantheonPrototype actions
Результат ControlActions

gamepadControls публичное свойство

public GamePadControls,PantheonPrototype gamepadControls
Результат GamePadControls

keyboardAndMouse публичное свойство

public MouseAndKeyboardControls,PantheonPrototype keyboardAndMouse
Результат MouseAndKeyboardControls