Loading...
Logo
Processing Forum
I am having an issue with the following code:

Copy code
  1. // GLOBALS
  2. PShape[] spzlSet;
  3. String baseURL = "";
  4. String[] spzlURLs = {
  5.   "spazzl1.svg",
  6.   "spazzl2.svg",
  7.   "spazzl3.svg"
  8. };


  9. // SETUP
  10. void setup(){
  11.   // use full screen
  12.   size(screen.width, screen.height);
  13.   background(255);
  14.   smooth();
  15.   // load shapes
  16.   spzlSet = new PShape[spzlURLs.length];
  17.   String s;
  18.   for (int i=0; i<spzlURLs.length; i++){
  19.     s = baseURL+spzlURLs[i];
  20.     println(s);
  21.     spzlSet[i] = loadShape(s);
  22.     
  23.   }
  24.   println("size: "+spzlSet.length);
  25.   shapeMode(CORNER);
  26.   noLoop();
  27. }

  28. // DRAW
  29. void draw(){
  30.   background(255);
  31.   for (int i=0; i<spzlSet.length; i++){
  32.     shape(spzlSet[i], 30+130*i, 30, 100, 111);
  33.   }
  34. }
I am getting the exception on line 36.

Any ideas?

Jon

Replies(1)

We don't have the full stack trace, but I am suspecting the problem isn't in your code itself, which looks OK, but perhaps in one of the shapes you load, causing an internal error in the PShape class.