# canvas-joystick

> Usage :

Latest version **0.0.9** (published 2019-11-11) · AGPLv3+ license · 0 weekly downloads

## Install

```sh
npm install canvas-joystick
pnpm add canvas-joystick
yarn add canvas-joystick
bun add canvas-joystick
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2019-11-11 |
| First published | 2019-11-10 |
| Weekly downloads | 0 |
| License | AGPLv3+ |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yannick A. |
| Maintainers | pifyz |

## Links

- npm: https://www.npmjs.com/package/canvas-joystick
- npm.io page: https://npm.io/package/canvas-joystick

## Recent versions

- 0.0.9 (latest) — 2019-11-11
- 0.0.8 — 2019-11-11
- 0.0.7 — 2019-11-10
- 0.0.6 — 2019-11-10
- 0.0.5 — 2019-11-10
- 0.0.4 — 2019-11-10
- 0.0.3 — 2019-11-10
- 0.0.2 — 2019-11-10
- 0.0.1 — 2019-11-10

## README

# Canvas Joystick

Usage :

```javascript
const joystick = new Joystick()

// on press
const pointerPosition = { x: [number], y: [number] }
joystick.setStartPosition(pointerPosition)

// while the pointer is pressed
const pointerPosition = { x: [number], y: [number] }
joystick.setPointerPosition(pointerPosition)

// get force
const force = joystick.getAxisValues() // { x: [number], y: [number] }

// render
joystick.render()

// parameters
joystick.setScale([number])

// methods
joystick.hide()
joystick.show()

// getters
joystick.getStartPosition()
joystick.getPointerPosition()
joystick.getScale()
```

---
_Source: https://npm.io/package/canvas-joystick · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
