I am using Processing 2.08 on mac. I am trying to create a PShape using the createShape function as given in the documentation.
PShape s;
void setup(){
size(500,500);
s = createShape();
s.beginShape(QUADS);
s.fill(0);
s.vertex(100,100);
s.vertex(100,300);
s.vertex(300,300);
s.vertex(300,100);
s.endShape();
}
void draw(){
shape(s);
}
But this program throws NullPointerException. Upon looking up on the Processing.org forum I found a thread saying that the new processing library has problem with this one.
ref: https://forum.processing.org/topic/changes-to-pshape-in-2-08
How do I make this work? Is there any workaround? Thanks