Cyrus
4 supporters
Joystick Controller

Joystick Controller

Feb 28, 2023

joystick-controller

A fully customizable JavaScript virtual joystick controller for both desktop and mobile devices supporting multi instances. Live Demo

NPM Page: https://www.npmjs.com/package/joystick-controller

Github Repository: https://github.com/cyrus2281/joystick-controller

Some of the customizable options are:

  • maxRange: Maximum range of the joystick dot (number of pixels)

  • level: Number of level of the* joystick (eg 10 would return integers between -10 and 10)

  • radius: Radius of the joystick container (number of pixels)

  • joystickRadius: Radius of the joystick inner dot (number of pixels)

  • opacity: Opacity of the joystick

  • leftToRight: Left to right adjustment (x position from left)

  • bottomToUp: Bottom to up adjustment (y position from bottom)

  • x: x position of the joystick controller on screen (equal to left/right of css)

  • y: y position of the joystick controller on screen (equal to bottom/top of css)

    distortion: if true, the joystick will be distorted when the dot is moved to the edge


Copyright(c) Cyrus Mobini 2023 - License MIT

Enjoy this post?

Buy Cyrus a coffee

More from Cyrus