Crates.io | ezinput |
lib.rs | ezinput |
version | 0.3.6 |
source | src |
created_at | 2022-01-22 16:05:15.909874 |
updated_at | 2022-06-08 18:17:59.148992 |
description | A powerful input-agnostic library targeting complete support to axis and button handling for the Bevy game engine. |
homepage | |
repository | https://github.com/eexsty/ezinput |
max_upload_size | |
id | 519198 |
size | 127,306 |
Input is relative; the library itself currently implements by default keyboard, mouse and gamepad support, but this is subject to change. Please feel free to contribute to the library by submitting pull requests. Touch support is stil planned, but not yet implemented.
ezinput strives to be simple as possible, while still being powerful and flexible without using any unsafe code.
All bindings are stored in a InputView
struct, which is passed as a component to your ECS entity. To allow an input method to be handled,
you need to add a service marker component (MouseMarker
, KeyboardMarker
or GamepadMarker
) to the ECS entity. You aren't limited to one marker, since you can use multiple markers to handle multiple input methods. An advantage of this implementation is that input views aren't
limited to specific input sources, so you can reutilize the same view for multiple input methods just by adding new input receivers to bindings.
Not everything is documented yet or documented with a high level of detail, so any feedback is appreciated. You can contact me on Discord or here on GitHub!
Branch | Bevy version |
---|---|
master | ^0.7 |
bevy_main | git (https://github.com/bevyengine/bevy.git) |
Add the following to your Cargo.toml
(replace ^0.3
with the latest version):
[dependencies]
ezinput = "^0.3"
use ezinput::prelude::*;
input!
macro. You can see an example here.
https://github.com/eexsty/ezinput/blob/master/src/macros.rs#L5-L45app.add_plugin(EZInputPlugin::<TheNameOfYourBindingsEnum>::default());
InputView
component! I recommend taking a look at the examples to get a feel for how to use it.