xxxxxxxxxx
25
let pg;
let img;
function preload() {
img = loadImage('https://picsum.photos/20/20'); // Load the image
}
function setup() {
createCanvas(400, 400);
pg = createGraphics(400, 400);
drawPG();
}
function draw() {
image(pg, 0, 0);
ellipse(mouseX, mouseY, 40, 40);
}
function drawPG() {
for (let i = 0; i < 20; i++) {
for (let j = 0; j < 20; j++) {
pg.image(img, i*20, j*20);
}
}
}