xxxxxxxxxx
23
/*
* Creative Coding Workshop #5 Demo - Display an Image
*
* Jack B. Du (github@jackbdu.com)
*/
let graphics;
// everything in preload() will be loaded before setup() is run
function preload() {
// load image into graphics variable
graphics = loadImage("abstract-fluid.png");
}
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
// draw graphics to fit entire canvas
image(graphics, 0, 0, width, height);
}