Last active
October 25, 2021 08:38
-
-
Save matt0rtega/bbb61e5ef2c422b48dc29ed3a3229952 to your computer and use it in GitHub Desktop.
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
PGraphics pg; | |
// We need to create variables for the width and height we want to use. | |
int scaleFactor = 2; | |
int w = 1080 * scaleFactor; | |
int h = 1920 * scaleFactor; | |
// In later versions of Processing, you need to use settings if you want to do any operations on the width and height | |
void settings(){ | |
size(w / 8, h / 8); | |
} | |
void setup() { | |
pg = createGraphics(w, h); | |
} | |
void draw() { | |
background(150); | |
pg.beginDraw(); | |
pg.background(150); | |
pg.ellipse(w/2, h/2, 100, 100); | |
pg.endDraw(); | |
image(pg, 0, 0, width, height); | |
if(keyPressed){ | |
if(key == 's') pg.save("image.png"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment