Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PGraphics pgBg, pgFg;
- void setup() {
- size(640, 360);
- //PGraphic Background
- pgBg = createGraphics(width, height);
- // PGgraphic Foreground
- pgFg = createGraphics(width, height);
- }
- void draw() {
- background(0);
- // Background PGraphic circle with white outline
- pgBg.beginDraw();
- pgBg.clear();
- pgBg.stroke(255);
- pgBg.strokeWeight(10);
- // replace this by the contour.draw();
- for (int i = -100; i <= 100; i += 50) {
- pgBg.ellipse(mouseX-15 + i, mouseY-15, 30, 30);
- }
- pgBg.endDraw();
- // Foreground PGraphic Blue circle with red outline
- pgFg.beginDraw();
- pgFg.clear();
- pgFg.fill(0, 0, 255);
- pgFg.stroke(255,0,0);
- pgFg.strokeWeight(4);
- // and ALSO replace this by the same contour.draw();
- for (int i = -100; i <= 100; i += 50) {
- pgFg.ellipse(mouseX-15 + i, mouseY-15, 30,30);
- }
- pgFg.endDraw();
- image(pgBg, 0, 0);
- image(pgFg, 0, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement