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

JoystickDis joystickAng #41

Open
lt15364967740 opened this issue Mar 25, 2024 · 5 comments
Open

JoystickDis joystickAng #41

lt15364967740 opened this issue Mar 25, 2024 · 5 comments

Comments

@lt15364967740
Copy link

Could you please explain the value range of setJoystick(joystickDis, joystickAng, runState) parameter? When I force the canvas to landscape, the gesture slide is perpendicular to the character movement direction, so I need to customize Joystick

@ErdongChen-Andrew
Copy link
Member

When the canvas change to landscape, the joystick should automatically adjust to fit the canvas 🤔
joystickDis default is 0-65, but it may vary depending on the size of the joystick
joystickAng is from 0-Math.PI
runState is a boolean, when joystickDis is higher than 70% of its max value, this will become true

@lt15364967740
Copy link
Author

https://github.com/lt15364967740/test
I used css to rotate the canvas to use landscape in portrait condition on the phone, I tried custom Joystick but the direction was still the opposite

@ErdongChen-Andrew
Copy link
Member

Rotating the entire canvas using CSS could mess up the orientation. Typically, we just rotate the phone to achieve landscape view.
Perhaps you could try rotating the joystick div as well, that might fix the issue.

@lt15364967740
Copy link
Author

When I rotate the css the slide is in the opposite direction of the gesture, but I don't know how to modify this coordinate and apply it to the camera

@ErdongChen-Andrew
Copy link
Member

Sorry, there is no way to modify the followCam coordinate. Rotating the canvas in CSS is not a common approach. Even if you just use a simple orbicontrol, the orientation of the camera would be off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants