so, i've made this code and programmed it to save a pdf once i pressed the 'b' key but when i go and check the pdf it had only saved like 10 frames or something!.
Code:import processing.pdf.*;
PShape a;
PShape b;
PShape c;
float xplus = 0.05;
float yplus = 0.05;
float xx = random(0, 0.05);
float yy = random(0, 10);
void setup(){
size(595,842);
beginRecord(PDF,"ilustração.pdf");
smooth();
frameRate(30);
}
float xpos = random(width);
float ypos = random(height);
void draw(){
float x = noise(xx)*width;
float y = noise(yy)*height;
float siZe = random(40);
xx += xplus;
yy += yplus;
a = loadShape("tattoo1.svg");
b = loadShape("tattoo2.svg");
a.disableStyle();
b.disableStyle();
float blu2 = random(255);
float blu3 = random(190,255);
if(x <180){
translate(x,y);
rotate(random(1));
shape(a,-27,-160);
}
else if(y > 592){
noStroke();
fill(252,122,0);
ellipse(x,y,siZe*3,siZe*3);
}
else if(x>180){
stroke(0.2);
fill(0,blu2,blu3);
rotate(random(1));
shape(b,x,y);
}
else{
fill(0,0,blu2);
stroke(0);
if(y< 200){
noStroke();
fill(252,122,0);
ellipse(x,y,siZe*3,siZe*3);
}
}
}
void keyPressed(){
if(key== 'b'){
endRecord();
noLoop();
}
}