image problem
in
Programming Questions
•
2 years ago
hi guys
I have a problem with my program, I just want to display an image when I wait during 5 seconds. The fact is that the image comes and leave immedialetly! 1 second maybe...
I let you my code if you want to help me. Thanks!
- // we need to import the TUIO library
- import TUIO.*;
- //and the libraries for the sound
- import ddf.minim.*;
- import ddf.minim.signals.*;
- import ddf.minim.analysis.*;
- import ddf.minim.effects.*;
- // we also need to declare a TuioProcessing client variable and a TuioObject variable
- TuioProcessing tuioClient;
- //timer
- int l;
- void setup()
- {
- size(1000, 1000);
- //lisser l'image
- smooth();
- //outline of a shape
- noStroke();
- //fill in black
- fill(0);
- }
- // within the draw method we retrieve a Vector (List) of TuioObject and TuioCursor (polling)
- // from the TuioProcessing client and then loop over both lists to draw the graphical feedback.
- void draw()
- {
- background(0);
- //display background
- PImage img1 = loadImage("test.bmp");
- //translate to get the fiducial in height
- translate(325, 300);
- image(img1, -325, -300, 1000, 1000); //import image
- int score=9;
- float z=millis()/1000;
- if (z==5) {
- for (int x=0;x<=100;x++) {
- if (score==9) {
- PImage img = loadImage("fin.jpg");
- image(img, 5, -20);
- fill(0, 0, 255);
- textSize(24);
- text("CONGRATULATION !!", 80, 50);
- text("You complete the game !", 70, 85);
- textSize(18);
- text("Points: ", 60, 150);
- text("Attemps", 60, 200);
- x++;
- }
- else {
- PImage img = loadImage("fin.jpg");
- image(img, 5, -20);
- fill(0, 0, 255);
- textSize(24);
- text("GAME OVER !!", 110, 50);
- textSize(18);
- text("Points: ", 60, 150);
- text("Attemps", 60, 200);
- x++;
- }
- }
- }
- }
1