0.0.9 • Published 6 years ago

canvas-joystick v0.0.9

Weekly downloads
-
License
AGPLv3+
Repository
-
Last release
6 years ago

Canvas Joystick

Usage :

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()
0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago