xxxxxxxxxx
79
let size;
let myPic;
let hMin;
let hMax;
let xPos;
let yPos;
let resized;
let cnv;
function setup() {
size = 111;
xPos=0;
yPos=-size*2;
hMin = 50;
hMax = 80;
colorMode(HSB,100,100,100);
size = 111;
cnv = createCanvas(1000, 1000);
myPic = loadImage("wok.png");
// noLoop();
fill(20,12,12);
rectMode(CORNER);
rect(0,0,width,height,30);
rectMode(CENTER);
myPic.resize(size,0);
}
function mouseClicked(){
// save(cnv,"pic.png");
save("image.jpg");
print("hi");
}
function draw() {
if(!resized){
myPic.resize(size,0);
resize=true;
}
// myPic.resize(size,0);
tint(random(hMin,hMax),random(10,70),random(89,95));
if(random(15) > 1){
image(myPic,xPos,yPos);
}
xPos+=size;
if(xPos > width){
yPos+=size;
xPos=0;
}
if(yPos > height){
save();
}
}