-
Notifications
You must be signed in to change notification settings - Fork 0
Canvas.js
dannyx0 edited this page Aug 10, 2012
·
3 revisions
The purpose of Canvas.js is as follows:
- Quick and flexible method for embedding a
<canvas>node. - Easy access to getting / setting the canvas context.
- Help with small things like window resizing and pixel ratios.
context [str] - Context type.
container [dom] - <canvas> container.
width [num/str] - Canvas width. "auto" fits to container.
height [num/str] - Canvas height. "auto" fits to container.
resize [bool] - Should the canvas width/height be reset when the window is resized?
<div id="canvas"></div>require(["Canvas"], function (canvas) {
canvas.init({
container : document.getElementById('canvas')
});
var ctx = canvas.context();
// Do cool things with canvas here.
});