We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi
This problem is driving me nuts! Is it possible to use PGraphics for a Sketch background?
Here is the example:
PGraphics pg;
void setup(){
size(640, 480);
pg = createGraphics(640, 480);
gMethod();
}
void draw(){
background(pg);
}
void gMethod(){
pg.beginDraw();
fill(255);
rect(0, 0, 100, 100);
pg.endDraw();
}
It displays the graphics for one frame and then it draws black. Is this a way how PGraphics behaves? Does it expire after one draw cycle?
Thanks
Answers
You need to call the fill() and rect() functions of your PGraphics instance, not the fill() and draw() functions of your sketch.
Compare your code to the documentation: http://www.processing.org/reference/PGraphics.html
Ha, ha, ha! This is so true! Thank you for saving me from insanity.
Just because I helped you with your code does NOT mean I saved you from insanity. You might be crazy as a loon! :p
Well, I don't know... Dali's quote: "The difference between me and the crazy man is that I am not crazy!" is the only psychotherapy I've had so far... 8-}