This commit is contained in:
Andrea Bianchi
2026-05-11 09:06:42 +09:00
parent e51e774ef8
commit 1cb979a571
205 changed files with 5906 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
let img;
let imgWidth = 100;
function setup() {
createCanvas(800, 600);
imageMode(CENTER);
img = loadImage('assets/light.jpg');
// Promisify this function
// img = loadImage('assets/light.jpg', (loadedImage) => {
// const ratio = loadedImage.height / loadedImage.width;
// loadedImage.height = imgWidth * ratio;
// loadedImage.width = imgWidth;
// });
}
function draw() {
background(255);
if (img) image(img, width / 2, height / 2);
}