Open Sigmoidle opened 7 months ago
Seems to be broken on android (using the example game https://sigmoidle.itch.io/comfy-touch-support-cat-ball-wow)
https://github.com/darthdeus/comfy/assets/15922601/7934a6ed-0c0a-4126-8478-042266db7b9f
To add to @juh9870's message, this behaviour also happens on IOS.
The function get_touch_position()
returns a position even when no fingers are on the screen.
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.
I've updated this pull request to fix the multi-touch bug and the lingering touch bug. Please try the itch.io game to preview the changes.
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