With my background set as an image, I want to play a transition effect using an image.
This is my code:
if (overStart == true) {
overTransition = frameCount;
overStart = false;
}
overTransitionEl = frameCount-overTransition;
if (overTransitionEl<=120)
tint(255, overTransitionEl*4.23);
else {
noTint();
}
pushMatrix();
imageMode(CENTER);
translate(width/2, height/2);
image(gameOver, 0, 0);
popMatrix();
Considering tint tints every image and not just the specific one (gameOver), the background (being an image) also fades in. Is there a workaround or do I have to leave out the transition?
Thanks!