0.0.9 • Published 5 years ago

canvas-joystick v0.0.9

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

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago