Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Mobile Support for Multi-Touch and Visibility #85

Open
avivajpeyi opened this issue Nov 4, 2024 · 4 comments
Open

HTML Mobile Support for Multi-Touch and Visibility #85

avivajpeyi opened this issue Nov 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@avivajpeyi
Copy link

Thanks for this awesome virtual joystick plugin.

I’m working on a project that uses the joystick in HTML builds (for mobile devices / PCs) and would appreciate any advice on two points:

  1. Multi-touch on HTML builds: Do you have any recommendations or tips to enable multi-touch support so the joystick works seamlessly on mobile browsers?
  2. Visibility on non-mobile HTML: Is there a way to set Visibility Mode <- TouchScreen only so that the joystick is hidden when running on non-mobile HTML environments?

Any guidance on this would be really helpful.
Thanks again for your work!

@MarcoFazioRandom
Copy link
Owner

Hello!
For the multi-touch issue, have you tried the solution explained in the documentation faq->multitouch-issue?
For the visibility, can you explain better what is your goal? When "touchscreen only" is enabled, the script check if the device has a touchscreen, if not the joystick is hidden.

@avivajpeyi
Copy link
Author

Hey @MarcoFazioRandom , thanks for your reply!

1. Multi-touch:
For multitouch -- yes, following your FAQ i had set

"Emulate Touch from Mouse" : ON
"Emulate Mouse from Touch" : OFF
Screenshot 2024-11-05 at 11 07 27 AM

Sorry -- i think my issue was not clear.

  • on web-macos/editor: I can interact with both the joystick and the click on things in the scene (my click and mouse position events are recognised)

  • on web-android (and i assume web-ios) touching anywhere on the screen leads to the joystick getting controlled, and other input-handler are not getting mouse-events (i assume the mouse events on web-android are triggered from screen touches)

2. touchscreen only

I have it enabled to touchscreen only, but it is till rendering the joystick on web_macos/editor?

Screenshot 2024-11-05 at 11 12 57 AM Screenshot 2024-11-05 at 11 16 10 AM

@MarcoFazioRandom
Copy link
Owner

Hi,

  1. As I understand the joystick is getting touchscreenevents, so maybe the joystick interactable area is covering the other buttons? Can you send a screenshot of the scene with the joystick selected, and one of the joystick's inspector?

  2. In the code I check the visibility mode with
    if not DisplayServer.is_touchscreen_available() and visibility_mode == Visibility_mode.TOUCHSCREEN_ONLY :
    I reread the documentation for DisplayServer.is_touchscreen_available(), it's said that it returns true if:

  • OS is Android or iOS
  • the capability is detected on the Web platform -> (Not clear what it means)
  • emulate_touch_from_mouse is true

from the last point, it means that it's always returning true and the code is not working properly, I will change the visibility mode code to check for the OS.

@MarcoFazioRandom MarcoFazioRandom added the bug Something isn't working label Nov 13, 2024
@MarcoFazioRandom
Copy link
Owner

Hey @avivajpeyi , for the first problem, do you have news? did you solve the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants