virtual-joystick-android
virtual-joystick-android copied to clipboard
Locked Joystick Not Returning Direction
When using...
custom:JV_buttonDirection="horizontal"
the joystick onMoveListener(int angle, int strength) always returns angle=~100, strength=0
The angle is 0 at center and 100 at both sides, instead of eg left to right
(left) -100 .. 0 .. 100 (right)
So how can i know which direction the user was pushing the handle in (left or right)?
Hi @adil192
Sorry for the late reply. In case you did not figure it yet. The joystick should return 180° on the left direction and 0° on the right direction. Could you send the complete configuration of the joystick (so I can reproduce the error)? It could be in XML (such as the one below) or in Java.
<io.github.controlwear.virtual.joystick.android.JoystickView
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="@+id/joystickView_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="32dp"
android:background="@drawable/joystick_background"
custom:JV_buttonImage="@drawable/pink_ball"
custom:JV_fixedCenter="false"
custom:JV_buttonDirection="horizontal"/>
Have a good day. Kindly, Damien