Created
August 29, 2023 15:57
-
-
Save dkgrieshammer/fe22e8634e032f711aa3fc21749a0ddf to your computer and use it in GitHub Desktop.
P5js hack to adjust export for printing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// P5js hack to adjust export for printing. | |
const exportScale = 4; | |
function keyPressed() { | |
if (key == 's' || key == 'S'){ | |
pixelDensity(exportScale); | |
draw(); | |
let fileName = | |
"yourP5project_" + year() + "_" + month() + | |
"_" + day() + "_" + hour() + "_" + minute() + | |
"_" + second() + ".png"; | |
saveCanvas(fileName); | |
pixelDensity(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment