Hello @druuupppa ,
Please format and post your code as per instructions here:
https://discourse.processing.org/faq#format-your-code
See Guidelines - Asking Questions
I suggest you take a look here:
Did you include the necessary p.
object prefix for all the elements you want in your PGraphics?
You are also passing your current PGraphics p
to the function. Is that intended? Give that some consideration.
A working, minimal, formatted example in static mode:
PGraphics pg;
size(100, 100);
pg = createGraphics(100, 100);
for(int i = 0; i<=90; i+=9)
{
pg.beginDraw();
pg.pushMatrix();
pg.noFill();
pg.rotate(radians(i));
pg.ellipse(50, 0, random(5, 20), 5); // drawPetal()
pg.popMatrix();
pg.endDraw();
}
image(pg, 0, 0);
Start with a simple working example and build on that one step at a time.
References:
:)