bevy
bevy copied to clipboard
Add bevy_picking sprite backend
Objective
Add bevy_picking
sprite backend as part of the bevy_mod_picking
upstreamening (#12365).
Solution
More or less a copy/paste from bevy_mod_picking
, with the changes here. I'm putting that link here since those changes haven't yet made it through review, so should probably be reviewed on their own.
Testing
I couldn't find any sprite-backend-specific tests in bevy_mod_picking
and unfortunately I'm not familiar enough with Bevy's testing patterns to write tests for code that relies on windowing and input. I'm willing to break the pointer hit system into testable blocks and add some more modular tests if that's deemed important enough to block, otherwise I can open an issue for adding tests as follow-up.
Follow-up work
- More docs/tests
- Ignore pick events on transparent sprite pixels with potential opt-out