Skip to content

Instantly share code, notes, and snippets.

@beshur
Created September 13, 2019 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beshur/4df11408a39dce27e533a5ae9f800dc2 to your computer and use it in GitHub Desktop.
Save beshur/4df11408a39dce27e533a5ae9f800dc2 to your computer and use it in GitHub Desktop.
Multiple covers on canvas
// image width and height
var iw = 132;
var imageCounter = 0;
var x = 0;
var y = 0;
var ctx = document.getElemenyById('c').getContext('2d');
ctx.fillStyle = "white";
ctx.fillRect(0, 0, 800, 1100);
// drawing
function drawpics(images) {
for(var i = 0; i < 8; i++) {
// row
for (var y = 0; y < 5; y++) {
// columns
draw(images[imageCounter++], 10 + iw * y, 10 + iw * i)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment