Skip to content

Instantly share code, notes, and snippets.

@zawa-works
Created December 6, 2018 16:32
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 zawa-works/f35c2932929c5ec21d963004e95275d3 to your computer and use it in GitHub Desktop.
Save zawa-works/f35c2932929c5ec21d963004e95275d3 to your computer and use it in GitHub Desktop.
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