Loading...
Logo
Processing Forum

Timer

in Programming Questions  •  2 years ago  
I want to trigger an animation with a camera, so when there's movement, the animation starts and stops after 5 or 6 secs until the next movement... 
any ideas?
i would appreciate if someone it's kind enough to illuminate me with an example!! X)
thanks a lot!

Replies(1)

Re: Timer

2 years ago
You can call millis() to get a current time.

You can save the result when your animation starts, and then just keep going until
Copy code
  1. (millis()-5000)>startTime
 for a five second delay

You can use noLoop() to halt calls to draw() (then restart it later) if you need the perf improvement

kb, http://www.riftgame.com/