jkb0o / belly

Define the Bevy UI tree with `eml!`, style it using a very-css-like `ess` syntax and relate data data with `bind!` and `connect!`
Apache License 2.0
406 stars 32 forks source link

Touch input does not work on android #76

Open Hellzbellz123 opened 1 year ago

Hellzbellz123 commented 1 year ago

my games menus do not work on android, the highlight function works but none the the press events are detected.

the party editor example exhibits the same behavior

Hellzbellz123 commented 1 year ago

did some digging and it seems like there is an issue with the cursor position and UiScale component, i updated the function too handle it the same way bevy did and it seems too make my cursor work, but touch events still do not work gonna keep at it

jkb0o commented 1 year ago

Hello there! Thank you for your interest to the project! Unfortunately I have no resources for diving into android because of #77. I'm very sorry.

I believe the problem is somewhere in input_system https://github.com/jkb0o/belly/blob/main/crates/belly_core/src/input.rs#L186. Looking forward to your investigation and hope it may lead to the PR.

Hellzbellz123 commented 1 year ago

I didn't fix it per se, but it seems like touch inputs where only triggering PointerInput::Down events, not pressed events, I extended the button widget too handle them and it started working, I also changed how the cursor position / touch position were grabbed, atm the ui will only support 1 touch, which is not really viable for release but it does make it work. I figure I can probably wrap the whole input system in an iterator over touches. However, I think I'd rather just split it into it's own system before I do that.

I saw the work on polako, I am looking forward too what it ends up looking like. I do like how the current styling and html layout works but I do understand the issues with them.

Hellzbellz123 commented 1 year ago

Like a bad coder I changed two things at once and it started working so I'm not sure which it actually was, I plan on going back and testing too figure it out.