Component you add to your GameObject to handle input, eg. add input bindings and mouse axis bindings. More...
#include <InputComponent.hpp>
Public Member Functions | |
| void | addBinding (SDL_Scancode scancode, InputActionState state, std::function< void(float)> action) |
| Adds input binding. | |
| void | addMouseAxisBinding (MouseAxis axis, std::function< void(float)> action) |
| Adds axis binding. | |
| void | addGamepadButtonBinding (SDL_GamepadButton button, InputActionState state, std::function< void(float)> action) |
| Adds gamepad button binding. | |
| void | addGamepadAxisBinding (SDL_GamepadAxis axis, std::function< void(float)> action) |
| Adds gamepad axis binding. | |
Public Attributes | |
| std::vector< InputBinding > | bindings |
| std::vector< MouseAxisBinding > | mouseAxisBindings |
| std::vector< GamepadButtonBinding > | gamepadButtonBindings |
| std::vector< GamepadAxisBinding > | gamepadAxisBindings |
Component you add to your GameObject to handle input, eg. add input bindings and mouse axis bindings.
Definition at line 58 of file InputComponent.hpp.
|
inline |
Adds input binding.
| SDL_Scancode | scancode - The SDL_Scancode of the key to bind. |
| InputActionState | state - The state of the key to bind. |
| std::function<void(float)> | action - The action to perform when the key is pressed. |
Example usage:
Definition at line 78 of file InputComponent.hpp.
|
inline |
Adds gamepad axis binding.
| SDL_GamepadAxis | axis - The SDL_GamepadAxis to bind. |
| std::function<void(float)> | action - The action to perform when the axis is moved. |
Example usage:
Definition at line 130 of file InputComponent.hpp.
|
inline |
Adds gamepad button binding.
| SDL_GamepadButton | button - The SDL_GamepadButton to bind. |
| InputActionState | state - The state of the button to bind. |
| std::function<void(float)> | action - The action to perform when the button is pressed. |
Example usage:
Definition at line 113 of file InputComponent.hpp.
|
inline |
Adds axis binding.
| MouseAxis | axis - The MouseAxis to bind. |
| std::function<void(float)> | action - The action to perform when the axis is moved. |
Example usage:
Definition at line 95 of file InputComponent.hpp.
| std::vector<InputBinding> vex::InputComponent::bindings |
Definition at line 59 of file InputComponent.hpp.
| std::vector<GamepadAxisBinding> vex::InputComponent::gamepadAxisBindings |
Definition at line 62 of file InputComponent.hpp.
| std::vector<GamepadButtonBinding> vex::InputComponent::gamepadButtonBindings |
Definition at line 61 of file InputComponent.hpp.
| std::vector<MouseAxisBinding> vex::InputComponent::mouseAxisBindings |
Definition at line 60 of file InputComponent.hpp.