Changing image background with given specific time

I’m 3rd year college student and I need a help about changing the image background with given specific time.

Hello,

There are lots of solutions out there for this… lots.

Think about how you may code a timer with the building blocks from the references below.

References:
https://processing.org/reference/millis_.html
https://processing.org/reference/frameCount.html
https://processing.org/reference/background_.html

Also look these up if not yet familiar:
https://processing.org/reference/setup_.html
https://processing.org/reference/draw_.html

:)

2 Likes

Hi @steven,

Pretty much everything listed you need by @glv.

Maybe some meta description…

On start
    Create an array with available images.
    Initialize variables for currentImageindex and nextUpdateTime with suitable values 

On draw loop
    check if currentTime >= nextUpdateTime
    If true
        increment currentImageindex mod size of image array
        add interval to nextUpdateTime
    set background using currentImageIndex on available images

Cheers
— mnse

1 Like