I am new to coding and I am working with this code to create a unique poster design using lines. I cannot successfully record a frame to an SVG file so I can use a pen plotter. I am sure I have a couple things out of order but I am too unfamiliar to identify the issue. If anyone has any suggestions, please help!!
//import svg library
import processing.svg.*;
//set up record boolean
boolean record;
//setup function runs only once
float x = 400;
void setup() {
size(600, 600);
frameRate(5);
//noLoop();
background(255);
smooth();
noCursor();
}
void draw(){
// check if recording
if (record) {
//begin recording and call the file frame-framenumber
beginRecord(SVG, "frame-###.svg");
}
translate(mouseY, mouseX);
x = x+1;
rotate(radians(x));
line(300, 150, 300, 120-x);
stroke(26);
//check if recording
if(record){
endRecord();
record = false;
}
}
//check for keypress
void keyPressed(){
if (key == 'b'){
record = true;
}
}