Newbie have a problem with PShape
in
Programming Questions
•
11 months ago
Hi,
I've just read the "tutorial" by Daniel Shiffman on PSHape.
But, every time I try this I've got an NullPointerException.
Here's my code :
- PShape pic;
- void setup(){
- size(800,600);
- frameRate(3);
- background(31);
- pic = createShape();
- pic.stroke(0);
- pic.strokeWeight(1);
- pic.vertex(0,0);
- pic.vertex(4,3);
- pic.vertex(10,10);
- pic.vertex(-4,3);
- pic.end(CLOSE);
- }
- void draw(){
- }
And here's the error log
- createShape(), or this particular variation of it, is not available with this renderer.
- Exception in thread "Animation Thread" java.lang.NullPointerException
- at sketch_121114a.setup(sketch_121114a.java:34)
- at processing.core.PApplet.handleDraw(PApplet.java:2103)
- at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
- at processing.core.PApplet.run(PApplet.java:2006)
- at java.lang.Thread.run(Thread.java:662)
LT
1