Processing Forum
PGraphics pg;
PGraphics opg;
void setup() {
size(100, 100, P2D);
pg = createGraphics(80, 80, P2D);
opg = createGraphics(80, 80, P2D);
pg.beginDraw();
pg.background(102);
pg.stroke(255);
opg.beginDraw();
opg.background(102);
opg.stroke(255);
opg.line(20, 20, 80, 80);
opg.endDraw();
pg.line(20, 20, 80, 80);
pg.image(opg, 50, 50);
pg.endDraw();
noLoop();
}
void draw() {
image(pg, 10, 10);
}
