Shape function draws nothing when given width and height

I am defining a custom PShape and attempting to redraw it a variable sizes.
When I simply use the command shape(shapename, x, y) it draws correctly.
When I use shape(shapename, a, b, c, d) where c and d are the width and height, it draws nothing. Anyone know why?

Here is my example code:

PShape myshape;
void setup(){
  size(500,500);
  myshape = createShape(GROUP);
  PShape rct,tri;
  rct = createShape(RECT,0,0,32,64);
  rct.setStroke(color(0,185,0));
  rct.setFill(color(0,120,0));
  tri = createShape();
  tri.beginShape();
  tri.fill(0,255,0);
  tri.stroke(0,200,0);
  tri.vertex(4, 4);
  tri.vertex(28, 32);
  tri.vertex(4, 60);
  tri.vertex(4, 2);
  tri.endShape();
  myshape.addChild(rct);
  myshape.addChild(tri);
  shape(myshape,125,250);
  shape(myshape,375,250,20,50);
}

pls format your code with the

</>

code formatter.

when i try your code i see something?


and what did you expect? oh yes,
the second one i only see with

PShape myshape;
PShape rct, tri;

void setup() {
  size(500, 500,P2D);
  myshape = createShape(GROUP);
  rct = createShape(RECT, 0, 0, 32, 64);
  rct.setStroke(color(0, 185, 0));
  rct.setFill(color(0, 120, 0));
  tri = createShape();
  tri.beginShape();
  tri.fill(0, 255, 0);
  tri.stroke(0, 200, 0);
  tri.vertex(4, 4);
  tri.vertex(28, 32);
  tri.vertex(4, 60);
  tri.vertex(4, 2);
  tri.endShape();
  myshape.addChild(rct);
  myshape.addChild(tri);
}
void draw() {
  background(200, 200, 0);
  shape(myshape, 125, 250);
  shape(myshape, 375,250,20,50);
}

Thanks for responding, my first time posting here and I wasn’t sure how to use the code formatting.

So your version works because you employed the P2D renderer in the size() function. I guess the default renderer can’t display it correctly. Hmm, oh well. Thanks!