@fezzle/joystick
TypeScript icon, indicating that this package has built-in type declarations

1.1.8 • Public • Published

joystick

A joystick for the web


Installation:

npm

npm install joystick
import { Joystick } from "@fezzle/joystick";

script tag

<script src="https://cdn.jsdelivr.net/npm/@fezzle/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);
}

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @fezzle/joystick

    Weekly Downloads

    1

    Version

    1.1.8

    License

    ISC

    Unpacked Size

    43.6 kB

    Total Files

    13

    Last publish

    Collaborators

    • fezzle