ebitengine-input icon indicating copy to clipboard operation
ebitengine-input copied to clipboard

Action Strength?

Open SolarLune opened this issue 2 years ago • 3 comments

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)?

SolarLune avatar Feb 02 '23 07:02 SolarLune

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 avatar Feb 02 '23 11:02 quasilyte

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

quasilyte avatar Feb 02 '23 11:02 quasilyte

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".

quasilyte avatar Feb 02 '23 13:02 quasilyte