@haelp/joystick
v1.1.9
Published
Joystick module for client side application
Downloads
2
Readme
joystick
A joystick for the web
Installation:
npm
npm install joystick
import { Joystick } from "@haelp/joystick";
script tag
<script src="https://cdn.jsdelivr.net/npm/@haelp/joystick"></script>
Use:
// create a new joystick instance
const joystick = new Joystick();
// add it to the dom tree
document.body.appendChild(joystick.dom);
// position it on the bottom left
joystick.style.cssText = "position: fixed; bottom: 30px; left:30px;";
joystick.on("move", (angle) => {
console.log('Joystick angle:', angle);
});