-
-
Notifications
You must be signed in to change notification settings - Fork 37
Add Touch Support #93
base: master
Are you sure you want to change the base?
Conversation
Removed wgpu::TextureUsages::COPY_SRC
Untested
Seems to be broken on android (using the example game https://sigmoidle.itch.io/comfy-touch-support-cat-ball-wow) 2024-03-01-15-26-09.mp4 |
To add to @juh9870's message, this behaviour also happens on IOS. The function Also, it seemingly only returns one finger at a time. I'm not sure how to fix this, I'll need some help from some more experience rust developers. |
Also, I believe that the touch API should have some level of interoperability with the mouse API. Even on the actual mobile devices, mouse pointers are not that uncommon, even as an accessibility feature: https://stackoverflow.com/a/54862570 Putting the burden of supporting both touch and mouse on the game developers is asking a bit too much, especially since developers coming from other languages would expect that they can just target one input method, and have the other work automatically, even if in a limited fashion. |
Untested
It now returns a vector of Vec2
I've updated this pull request to fix the multi-touch bug and the lingering touch bug. |
I have exposed the following function to the user:
get_touch_locations() -> Vec<Vec2>
Things to check:
Example usage:
Compiles with:
Works with:
Please try my test game at: https://sigmoidle.itch.io/comfy-touch-support-cat-ball-wow
The itch.io page includes the repository for the test game.
PLEASE NOTE: The changes to
devices.rs
may not work for all users and should be reviewed.Currently broken:
No multi-touch support out-of-the-box- fixedTouch position doesn't reset (to none?) when no fingers are on the screen.- fixed