Open lt15364967740 opened 3 months ago
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
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
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.
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
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.
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