Leafwing-Studios / leafwing-input-manager

A straightforward stateful input manager for the Bevy game engine.
Apache License 2.0
727 stars 115 forks source link

Missing user story for CursorMoved / mouse position (as opposed to motion) #634

Open teohhanhui opened 2 months ago

teohhanhui commented 2 months ago

What problem does this solve?

Something like https://github.com/StarArawn/bevy_ecs_tilemap/blob/main/examples/mouse_to_tile.rs

What solution would you like?

An example that demonstrates how the use case of tracking the cursor's position in the window should be handled.

[Optional] How could this be implemented?

Needs an example... There's mention of a certain mouse_position example here, but no such example exists:

https://github.com/Leafwing-Studios/leafwing-input-manager/blob/36441c71a8f73e978b05f27b33e735ec14a07bf4/examples/twin_stick_controller.rs#L7

(EDIT: I see it was removed in #581)

Ideally it should also show things like mapping to world position and more, otherwise the story would be incomplete.

[Optional] What alternatives have you considered?

Use CursorMoved? But it still would be nice to have an example to show how it'd integrate with leafwing-input-manager.

Related work

No idea...

alice-i-cecile commented 2 months ago

Totally agree: we should at least demonstrate how to do this. "Relative to the player" is the primary method here.