We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi!
I'm trying to show an image with Pimage during X seconds.
Here is my actual code (simplified):
PImage Image_Caisse_Claire;
PImage Image_Caisse_Claire_Hot;
void setup()
{
size(1080, 610);
}
void draw()
{
Image_Caisse_Claire=loadImage("Caisse_Claire.png");
Image_Caisse_Claire_Hot=loadImage("Caisse_Claire_Hot.png");
}
void keyPressed()
{
if (keyPressed == true && key == 'a' && menu == 2)
{
image(Image_Caisse_Claire_Hot, 140, 310, 258, 136); // My problem is here
}
}
Thank you!
Answers
See http://forum.processing.org/two/categories/common-questions
Lot of topics addressing errors you make in your little code...
One of them is almost identical to your request!
Tip 1: Don't load images in draw()!
Tip 2: Don't draw in events like keyPressed(): change booleans (for example) and take in account these values in draw().