new Mouse(canvas, world, callback)
Create and start mouse obj, args: a model, and a callback method.
Parameters:
Name | Type | Description |
---|---|---|
canvas | Canvas | | The canvas upon which we track the mouse. If a string is given, get the HTML element by that name |
world | world | World instance |
callback | function | callback(mouse) called on every mouse action |
Methods
start()
Start the mouseListeners.
Returns:
this Return this instance for chaining
stop()
Start the mouseListeners.
Returns:
this Return this instance for chaining