You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have worked on some more input improvements. The previous iteration was a good start but it was a little bit to overloaded and complex.
I focused on abstracting input devices so that as a developer you don't have to worry from what type of device the input is coming from. Right now this abstraction works for mouse, keyboard, and gamepad.
For example, you can create actions (like player jump) and tell the action to listen for the "Space" key, the "Left" mouse button, and the "A" button on a gamepad. Then the action reports an accumulated state for all the input types it listens for.
Furthermore axis can be used as buttons and any 2 buttons can be combined to an axis.
Buttons have 4 states:
- Up
- Down
- Pressed (1 Frame)
- Released (1 Frame)
Axis have a value range between -1 and 1 or 0 and 1, depending on the axis. The left joystick horizontal axis reports values between -1 and 1, while the right trigger reports values between 0 and 1.
With this system any button also reports axis values (0 to 1 value range) and every axis also reports the 4 states of a button.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
I have worked on some more input improvements. The previous iteration was a good start but it was a little bit to overloaded and complex.
I focused on abstracting input devices so that as a developer you don't have to worry from what type of device the input is coming from. Right now this abstraction works for mouse, keyboard, and gamepad.
For example, you can create actions (like player jump) and tell the action to listen for the "Space" key, the "Left" mouse button, and the "A" button on a gamepad. Then the action reports an accumulated state for all the input types it listens for.
Furthermore axis can be used as buttons and any 2 buttons can be combined to an axis.
Buttons have 4 states:
- Up
- Down
- Pressed (1 Frame)
- Released (1 Frame)
Axis have a value range between -1 and 1 or 0 and 1, depending on the axis. The left joystick horizontal axis reports values between -1 and 1, while the right trigger reports values between 0 and 1.
With this system any button also reports axis values (0 to 1 value range) and every axis also reports the 4 states of a button.
YouTube
Changelog
Beta Was this translation helpful? Give feedback.
All reactions