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

Locked Joystick Not Returning Direction #22

Open
adil192 opened this issue May 23, 2018 · 1 comment
Open

Locked Joystick Not Returning Direction #22

adil192 opened this issue May 23, 2018 · 1 comment

Comments

@adil192
Copy link

adil192 commented May 23, 2018

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)?

@makowildcat
Copy link
Member

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

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