Problem: What i am trying to achieve is a background image that stays for 50 seconds and then after 10 seconds, clear the background, change the background image for just 10 seconds and then go back again to the original image and so on.
In the draw im checking if firstTimer.isFinished() and if so i change the background image and then restart the timer. obviously this happens really quickly (like 1 frame) so im trying to put the second timer and its not working.
Im sure its so easy and im incredibly silly but i cant see the answer for looking.
- import processing.opengl.*;
- Timer firstTimer, secondTimer;
- PImage firstScreen, secondScreen;
- void setup() {
- size(800, 800, OPENGL);
- firstTimer = new Timer(50000);
- secondTimer = new Timer(10000);
- firstScreen = loadImage("footer2.png");
- secondScreen = loadImage("footer3.png");
- }
- void draw() {
- if (firstTimer.isFinished()) {
- background(0);
- image(secondScreen,0, 0, width, height);
- //need to pause it for 10 seconds
- //then restart timer
- firstTimer.start();
- }
- else
- {
- image(firstScreen, 0, 0, width, height);
- }
- fill(255);
- ellipse(mouseX, mouseY, 20, 20);
- }
Like i say this works it just doesnt pause long enough to show the secondScreen.which will of course keep the background clear even moving the mouse around
I really need to got through 3 screens, one at 45 seconds, one at 10 and then one at 5
If someone can point me in the right direction that would be great
1