Tried, but it doesn't work as i get an error message ( unexpected token: { )pointing at
Quote:PImage[] images = new PImage{img0, img1, img2};
Here is the portion of the code where i put your example :
Quote: PImage img0 = loadImage("skin0.png");
PImage img1 = loadImage("skin1.png");
PImage img2 = loadImage("skin2.png");
PImage[] images = new PImage{img0, img1, img2};
PImage texture = images[ round(random(0,2))];
void getFrogs(){
float[] pos;
textureMode(NORMALIZED);
beginShape();
texture(images);
........
}
So after reading the PImage reference section, i changed the {} by ().
Now i get :
Quote:/tmp/build40927.tmp/Temporary_5188_8530.java:36:23:36:50: Semantic Error: No applicable overload was found for a constructor with signature "PImage(processing.core.PImage, processing.core.PImage, processing.core.PImage)" in type "processing.core.PImage". Perhaps you wanted the overloaded version "PImage(int $1, int $2, int $3);" instead?
/tmp/build40927.tmp/Temporary_5188_8530.java:242:13:242:18: Semantic Error: No accessible field named "images" was found in type "Temporary_5188_8530$Frogs".
What's wrong with it ?