Name of the loaded shape

Hello,

i load few shape in an array.
i change the used shape in the drawing area.
the only thing i know is the index of the shape in the array.

int nbrI = 24;
PShape[] pinceaux = new PShape[nbrI];

for (int i=0; i<nbrI; i++) {
    pinceaux[i] = loadShape("medias/image_"+i+".svg");
  }

is there a way to have more information about the shape loaded in the array.
if i ask println("numeroDuPinceau:",pinceaux[numeroDuPinceau]);
i received an @number
numeroDuPinceau: processing.awt.PShapeJava2D@3873f7c8
is there property of this object like url or path to identify the shape in the cells’s array?

thanks

Hello @mrbbp,

You can save the path in another array to save additional info:

int nbrI = 24;
String [] shapeInfo = new String [nbrI]; 

for (int i=0; i<nbrI; i++) 
  {
    String strPath = "medias/image_"+i+".svg";
    shapeInfo [i] = strPath;
    }

:)

oh yes!
really good (where is my mind?)
i keep it!
thanks a lot.

2 Likes