Instead, you're going to have to use data structures: like an array or ArrayList of Shape objects (you might have to create your own class, or use the PShape class). Add to that data structure to draw a shape, and then modify those shapes to move them around.
PGraphics is what Processing uses for off-screen buffers -- but you draw into them in the same way that you do the screen, so I'm not sure if it will help you with "sliding/smearing".
Both PGraphics() and PImage() can be rendered in the draw loop with the image() call, which accepts coordinates. So if you want to render a fancy shape, and then slide it around the screen (e.g. following mouseX / mouseY), then the normal way is to create and PGraphics or PImage object, draw into it, and then use variables to translate it while rendering it in the draw() loop using e.g. image(myImage, mouseX, mouseY);
Answers
That's not really going to work.
Instead, you're going to have to use data structures: like an array or
ArrayList
ofShape
objects (you might have to create your own class, or use thePShape
class). Add to that data structure to draw a shape, and then modify those shapes to move them around.PGraphics is what Processing uses for off-screen buffers -- but you draw into them in the same way that you do the screen, so I'm not sure if it will help you with "sliding/smearing".
Both PGraphics() and PImage() can be rendered in the draw loop with the image() call, which accepts coordinates. So if you want to render a fancy shape, and then slide it around the screen (e.g. following mouseX / mouseY), then the normal way is to create and PGraphics or PImage object, draw into it, and then use variables to translate it while rendering it in the draw() loop using e.g.
image(myImage, mouseX, mouseY);