Created
December 6, 2018 16:32
-
-
Save zawa-works/f35c2932929c5ec21d963004e95275d3 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
int circleX, circleY; | |
void setup() { | |
size(500, 500); | |
circleX = width/2; | |
circleY = height/2; | |
} | |
void draw() { | |
background(-1); | |
ellipse(circleX, circleY, 200, 200); | |
panel(mouseX, mouseY); | |
} | |
void panel(int pgX, int pgY) { | |
PGraphics pg = createGraphics(200, 200); | |
pg.beginDraw(); | |
pg.background(0); | |
pg.fill(255, 0, 0); | |
pg.ellipse(circleX - pgX, circleY - pgY, 200, 200); | |
pg.endDraw(); | |
image(pg, pgX, pgY); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment