crtrdg-mouse

mouse module for 2d games. designed for games using the canvas.

crtrdg-mouse

mouse event listener module for crtrdg

npm install --save crtrdg-mouse

Create the mouse object

Parameters

  • game Object – a crtrdg game object

Examples

var createGame = require('crtrdg-gameloop')
var createMouse = require('crtrdg-mouse')
 
var game = createGame()
var mouse = createMouse(game)

'click' event

Parameters

  • location object – click coordinates

'mousedown' event

Parameters

  • location object – mousedown coordinates

'mousemove' event

Parameters

  • location object – mousemove coordinates

'mouseup' event

Parameters

  • location object – mouseup coordinates
  • Fork this repository.
  • Create a branch for you changes.
  • Include tests if applicable.
  • Add/edit documentation for any changes.
  • Submit a pull request.

MIT