0.0.9 • Published 7 years ago

canvas-joystick v0.0.9

Weekly downloads
-
License
AGPLv3+
Repository
-
Last release
7 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

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago