Hey,
I’m have written a small code for a sort of text-warping tool using PGraphics, PFont, and the copy() function. I would like to output “Many Frames Into One File (With Screen Display)” as explained in the PDF library, but I am now receiving the error code: “No copy() for PGraphicsPDF” when I run my code. Below is my code as it stands. Any thoughts on how to remedy this issue and export a PDF (or even just a very High-Res .png or .jpeg) of my screen display while using the copy() function?
PGraphics pg;
PFont font;
int on=1;
int move = 0;
float x;
float y;
float easing = 0.05;
import processing.pdf.*;
void setup(){
size(800,800);
background(0);
beginRecord(PDF, "everything.pdf");
font = createFont("governor.ttf", 300);
pg = createGraphics(800,800);
}
void draw() {
float targetX = mouseX; //Movement Easing
float dx = targetX - x;
x += dx * easing;
float targetY = mouseY;
float dy = targetY - y;
y += dy * easing;
pg.beginDraw(); //Draw Letters
pg.background(0,0,0);
pg.fill(255);
pg.textFont(font);
pg.textSize(150);
pg.pushMatrix();
pg.translate(x, y);
pg.textAlign(CENTER, CENTER);
pg.text("TEXT", 0, 0);
pg.popMatrix();
pg.endDraw();
copy(pg, 0, move, width, 1, 0, move, width, 1); // Copy/Paste
move = move + 1; //Advance Copy/Paste line
if (move > height){
move = 0;
background(0);
}}
void mousePressed() { //ON/OFF switch
if(on<0){
loop(); on=on*-1;
}else{ noLoop();on=on*-1;}
}
void keyPressed() { //End recording/Exit
if (key == 'q') {
endRecord();
exit();
}
}