import processing.pdf.*; /////////////////////////////// int x = 0; int y = 0; int x2 = 0; int y2 = 0; int humeur = 0; int frame = 0; boolean record; int recording = 0; //////////////////////////// void setup(){ size(800,600); background(255); } void draw(){ if (record) { beginRecord(PDF, frameCount + ".pdf"); frame = frameCount; record =! record; recording = 1; println("start draw"); } ///////////////////////////////////////////////////// draw1(); for(int i=0; i<50; i++){ draw2(); } //if (frame == 10) exit(); //println(frame); ///////////////////////////////////////////////////// if(recording == 1){ if(frameCount>frame+25){ endRecord(); println("finish"); recording = 0; } } } /////////////////////////////////////////////////// void draw1(){ stroke(0,0,255); y = 0; x+= humeur; for(int i=0; iwidth) || (x<-100)){ x=-100; } } /////////////////////////////////////////////////////// void draw2(){ stroke(255,255,255); y2 += humeur; x2 = 0; for(int i=0; iheight) || (y2<-100)){ y2=-100; } } //////////////////////////////////////////////////////// void mousePressed() { // Vous pouvez activez la fonction Save... Mais les fichiers pdf seront lourd... (dsl pb de conception...) //record =! record; } ////////////////////////////////////////////////////