Skip to content

Instantly share code, notes, and snippets.

View todiadiyatmo's full-sized avatar

Todi Adiyatmo Wijoyo todiadiyatmo

View GitHub Profile
$(document).ready(function() {
// create canvas
var canvas = document.createElement("canvas");
canvas.height = 300; // important! because default canvas size is 300x150
var ctx = canvas.getContext('2d');
// create img
var img = document.createElement("img");
// IMPORTANT adding shadow map - each area has different background color