Skip to content

Instantly share code, notes, and snippets.

@sampottinger
Created November 26, 2019 00:43
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 sampottinger/36ca3e3c57f510380b8be597c95f1eb8 to your computer and use it in GitHub Desktop.
Save sampottinger/36ca3e3c57f510380b8be597c95f1eb8 to your computer and use it in GitHub Desktop.
PGraphics pg;
void settings() {
size(100, 100, FX2D);
pixelDensity(2);
}
void setup() {
pg = createGraphics(40, 40);
println(displayDensity());
}
void draw() {
pg.beginDraw();
pg.background(100);
pg.stroke(255);
pg.line(20, 20, mouseX, mouseY);
pg.endDraw();
image(pg, 9, 30);
image(pg, 51, 30);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment