quasilyte / ebitengine-input

A Godot-inspired action input handling system for Ebitengine
MIT License
66 stars 8 forks source link

Action Strength? #14

Open SolarLune opened 1 year ago

SolarLune commented 1 year ago

Hello, great work on this input add-on! Really appreciate the community making tools like this - I was wondering if I missed it or not, but is there an action strength system (so that you can, for example, tilt the stick on a gamepad to move at variable rates)?

quasilyte commented 1 year ago

Hi! There is no separate "strength" event info.

Right now some events have extra Vec info (X+Y). Gamepad events usually have them, that Vec would be a union vector of the gamepad stick state. For instance, (-1, 0) means the stick is at the leftmost position.

quasilyte commented 1 year ago

Ah, well, I was only partially correct. I'll try to bake an example that uses smooth movement based on the gamepad sticks.

quasilyte commented 1 year ago

Please take a look at https://github.com/quasilyte/ebitengine-input/blob/master/_examples/smooth_movement/main.go

I'll probably add the same "Motion" mouse events so they could both be listed in the key list for the action. Like "KeyGamepadRStickMotion, KeyMouseMotion".