🛠 Saves data to a file.
If data is not specified, the canvas will be saved.
If no arguments are provided, the canvas will be saved as an image file named "untitled.png".
Optional
canvas, image, or JS object
filename to save as
await Canvas(200);background(0.8);circle(0, 0, 50);q5.mousePressed = function () { save('circle.png');}; Copy
await Canvas(200);background(0.8);circle(0, 0, 50);q5.mousePressed = function () { save('circle.png');};
await Canvas(200);background(0.8);text('save me?', -90, 0);textSize(180);let bolt = createTextImage('⚡️');q5.mousePressed = function () { save(bolt, 'bolt.png');}; Copy
await Canvas(200);background(0.8);text('save me?', -90, 0);textSize(180);let bolt = createTextImage('⚡️');q5.mousePressed = function () { save(bolt, 'bolt.png');};
🛠 Saves data to a file.
If data is not specified, the canvas will be saved.
If no arguments are provided, the canvas will be saved as an image file named "untitled.png".