Skip to content

Instantly share code, notes, and snippets.

@Morpholux
Created July 23, 2021 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Morpholux/cfd626aa17ac1e3c69f0018243d1ba42 to your computer and use it in GitHub Desktop.
Save Morpholux/cfd626aa17ac1e3c69f0018243d1ba42 to your computer and use it in GitHub Desktop.
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.5.4
// vendredi, 23 juillet 2021
PGraphics pg; // declaration of PGraphics object
void setup() {
size(600, 600);
background(0);
pg = createGraphics(200, 200); // construction of PGraphics object at it’s own size
// PGraphics is build only once, in the setup()
// Note that every methods is called using name of instance before : like pg.fill()
pg.beginDraw();
pg.noFill();
pg.stroke(255);
pg.strokeWeight(3);
for (int i = 12; i <=272; i+= 20 ) { // 14 copies
pg.circle(100, 100, i);
}
pg.endDraw();
}
void draw() {
background(0);
for (int j = 0; j<=400; j+=200) {
for (int i = 0; i<=400; i+=200) {
image(pg, i, j);
}
}
}
@Morpholux
Copy link
Author

pg

@Morpholux
Copy link
Author

Morpholux commented Jul 24, 2021

The reference for the PGraphics object on the Processing Web site:
PGraphics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment