if you don't need to control the amount of fading and images are triggered by bang, this should do what you try to achieve :
click to change image. change the amount of tint(255, amount) to change the timing of the fading.
click to change image. change the amount of tint(255, amount) to change the timing of the fading.
- PImage[] img= new PImage[25];
int counter = 0;
void setup()
{
size (400, 400);
for (int i = 0; i<25; i++)
{
img[i] = loadImage(i+".jpg");
}
}
void draw()
{
tint(255, 10);
image(img[counter], 0, 0, width, height);
}
void mousePressed()
{
counter++;
if (counter >img.length-1)
{
counter =0;
}
}