xxxxxxxxxx
19
let tree;
function setup() {
createCanvas(400, 400);
//no loop is loading faster
noLoop();
}
function draw() {
background(128);
// when loadImage is succesful, the function imageLoaded is called
tree = loadImage("birch.png", imageLoaded);
}
// name should match with line 13
function imageLoaded() {
image(tree, 200, 200, 100, 200);
}