GithubHelp home page GithubHelp logo

lgenzelis / joystickview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from efficientisoceles/joystickview

0.0 2.0 0.0 104 KB

A simple Android joystick that can be easily added to activities.

License: GNU General Public License v3.0

Java 100.00%

joystickview's Introduction

JoystickView

A simple Android joystick that can be easily added to activities.

##Installation instructions:

  1. Copy-Paste the JoystickView class into your Android project
  2. Update the package information for the JoystickView so that it matches your package directory
  3. Add it to your Activity's XML by using <YOUR PACKAGE HERE.JoystickView /> and set its attributes. It takes on the same attributes as a SurfaceView
  4. Implement the JoystickView.JoystickListener interface in the activity you are using and implement the onJoystickMoved() method. The onJoystickMoved method contains 2 floats between 0 and 1, indicating how far along the x and y (respectively) the joystick has been moved relative to its maximum. It also contains an int at the end, which is the id of the joystick that is being moved. This id is equal to R.id.YOUR_JOYSTICK_NAME, assigned via android:id in the XML

##To be added in the future:

  • More comments, and an actual JavaDoc. For now, the Instructable I made this for will have to suffice as explanation
  • XML attributes that allow the joystick's color to be changed directly from the xml rather than from code
  • Better joystick shading

##For more info... Visit the instructable I made for this!: http://www.instructables.com/id/A-Simple-Android-UI-Joystick/

joystickview's People

Contributors

efficientisoceles avatar

Watchers

James Cloos avatar Lucas Genzelis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.