poin

3.0.0 • Public • Published

Poin

A javascript utility for polling the state of the pointer (be it mouse or touch).

Usage

You can poll the position of the pointer using Poin.position. This works for both the mouse pointer and the touch screen pointer.

player.position.x = Poin.position.x
player.position.y = Poin.position.y

You can poll the state of a press using Poin.wasJustPressed(buttonNumber). For buttonNumber, you can also use button names like primary for 0 or secondary for 2. If you don't put any button number or button name, it defaults to 0.

if(Poin.wasJustPressed("primary")) player.shoot()
if(Poin.wasJustPressed("secondary")) player.reload()

License

This project is licensed under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i poin

Weekly Downloads

17

Version

3.0.0

License

MIT

Unpacked Size

3.97 kB

Total Files

4

Last publish

Collaborators

  • ehgoodenough