Skip to content

Drawing layers

The drawLayers() method clears the canvas, and draws the canvas’s layers.

$('canvas').drawLayers();

As of v20.2.0, You can also specify a complete callback to run when all layers have been drawn. This can be useful if you have any image layers because jCanvas would normally wait for those images to load asynchronously before continuing to draw other layers.

$('canvas').drawLayers({
complete: function () {
console.log('done!');
}
});