Skip to content

clkasd/JoystickView

Repository files navigation

JoystickView

A JoystickView library for Android with an example

Joystick controller for android applications.

*Simple usage

*Callback interface implemented.

*Power and degree values returned.

*Changable assets.You can change joystick images as you wish.

From xml add the lines below: XML:

    <com.developwear.joystickview.JoystickView
    android:id="@+id/joystickview"
    android:layout_width="500px"
    android:layout_height="500px" />

And from your java class set joystickChangeListener:

    joystickView=(JoystickView)findViewById(R.id.joystickview);
    joystickView.setJoystickChangeListener(new JoystickView.JoystickChangeListener() {
        @Override
        public void onJoystickChanged(int power, int degree) {
            textView.setText("power:".concat(String.valueOf(power).concat(" - ")).concat("degree:").concat(String.valueOf(degree)));
        }
    });

Installation

You can either add as a module or directly add to build.gradle file as shown below:

    compile 'com.developwear:joystickviewlib:1.0.1'

About

JoystickView for Android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages