xxxxxxxxxx
23
var img;
function preload() {
img = loadImage('alberta.jpg');
}
function setup() {
createCanvas(800, 800);
}
function draw() {
var tileCountX = mouseX /2;
var tileCountY = mouseY /100;
var stepX = width / tileCountX;
var stepY = height / tileCountY;
for (var gridY = 0; gridY < height; gridY += stepY) {
for (var gridX = 0; gridX < width; gridX += stepX) {
image(img, gridX*2, gridY, stepX, stepY);
}
}
}