xxxxxxxxxx
30
/* export SVG
DDF 2018
need to have p5.svg.js in project and in index.html
see -https://github.com/zenozeng/p5.js-svg
this will save an SVG file in your download folder
*/
function setup() {
createCanvas(400,400,SVG);
background(255)
stroke(0)
translate(width/2, height/2)
}
function draw() {
ellipse(0,0,100,100)
//////////////////////////////////////EXPORT
if (keyCode === LEFT_ARROW){
save("mySVG.svg");
print ("saved svg");
noLoop();
}
}