Using the CanvasResizer class to manage canvas size

With the CanvasResizer, you can set the canvas size several ways:

With all of the modes, you can map touch and mouse events to the canvas coordinate space with a simple function call.

Try clicking or touching on the canvas, or resizing the browser window.

Compatibility: Chrome 47 (full), Firefox 42 (full), IE 11 (full).