PlayerInput¶
Inherited: None
Description¶
Note: A PlayerInput controller simplifies the management of the player control scheme. It can be used to get the current state of actions from the assigned ControlScheme.
Public Methods¶
float |
axis (const TString & name) |
bool |
button (const TString & name) |
controlScheme () const |
|
void |
setControlScheme (ControlScheme * scheme) |
Static Methods¶
None
Methods Description¶
float PlayerInput::axis (TString & name)
Returns the value of the virtual axis identified by name. The value will be in the range -1…1 for keyboard and joystick input devices.
bool PlayerInput::button (TString & name)
Returns true in case of virtual button identified by name is pressed; otherwise returns false.
ControlScheme * PlayerInput::controlScheme () const
Returns the current assigned control scheme.
See also setControlScheme().
void PlayerInput::setControlScheme (ControlScheme * scheme)
Assigns a new control scheme. All previous bindings and key states will be cleaned.
See also controlScheme().