# @sflabs/pixi-joystick

> ## Usage

Latest version **6.0.4** (published 2022-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sflabs/pixi-joystick
pnpm add @sflabs/pixi-joystick
yarn add @sflabs/pixi-joystick
bun add @sflabs/pixi-joystick
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.0.4 |
| Published | 2022-07-27 |
| First published | 2021-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daniil Kaverzin |
| Maintainers | dimitreee14, lkptman |

## Links

- npm: https://www.npmjs.com/package/@sflabs/pixi-joystick
- npm.io page: https://npm.io/package/@sflabs/pixi-joystick

## Dependencies (1)

- [@pixi/graphics-smooth](https://npm.io/package/@pixi/graphics-smooth.md) ^0.0.30

## Recent versions

- 6.0.4 (latest) — 2022-07-27
- 6.0.3 — 2021-10-29
- 6.0.2 — 2021-10-28
- 6.0.1 — 2021-10-28
- 6.0.0 — 2021-10-28
- 5.0.2 — 2021-10-28
- 5.0.1 — 2021-10-28
- 5.0.0 — 2021-10-28
- 4.0.0 — 2021-10-27
- 3.0.0 — 2021-10-22
- 2.2.3 — 2021-10-19
- 2.2.2 — 2021-10-19
- 2.2.1 — 2021-10-19
- 2.2.0 — 2021-10-19
- 2.1.0 — 2021-10-19
- … 5 more at https://npm.io/package/@sflabs/pixi-joystick/versions

## README

# pixi-joystick

## Usage

```typescript
import { Joystick } from '@sflabs/pixi-joystick';

const joystick = new Joystick(app.stage, { x: 44, y: 44 });

joystick.onStart(() => {
  console.log('start');
});

joystick.onChange((angle, power) => {
  console.log(angle, power);

  // Radians
  console.log(joystick.angle);

  // From 0 to 1
  console.log(joystick.power);
}, 500);

joystick.onEnd(() => {
  console.log('end');
});

setTimeout(() => {
  joystick.x = 88;
  joystick.y = 88;
}, 5_000);

setTimeout(() => {
  joystick.destroy();
}, 10_000);
```

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