Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : using timer

$
0
0
Without answering fully your request, as I haven't played much with the Movie library, here are some generic advices:
- Load help.png in setup(): if you load in the middle of a sketch, it will make a visible stop in the succession of frames, so when you don't need to load a bunch of images, just load them upfront.
- The condition you look for is:
if (millis() > time2)
if you want the event to happen after time2.
At a simple level, if you want to display the movie for the first period and the image after it, it would be something like:
  1. void draw() {
  2.   background(0);
  3.   if (millis() < time2) {
  4.     image(movie, 0, 0);
  5.   } else {
  6.     image(helpimg, 0, 0);
  7.   }
  8. }
If you want more complex conditions, you can start to use booleans or integers to reflect the state of your sketch.
For example, with integers, you can number steps:
1 = display movie
2 = display help
3 = display movie again, for a different duration
etc.
The switch keyword is useful for this kind of state management...

Viewing all articles
Browse latest Browse all 1768

Trending Articles