Learn creative coding writing simple programs

84. Draw gradients, review functions and image loading

This time we don't introduce new concepts but review previous ones. First we rename a variable to give it a more correct name. Then we convert two global variables into local variables and the program becomes slightly shorter. Next we change the program so instead of just drawing one circular gradient it draws a new one each time we click the screen. For that we see again how functions are declared, and how parameter types must match.
Finally we try loading and displaying an image as a background, so the screen is not so empty when the program starts :)

Tags: load, image, gradient, function, global, local, rename, variable

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus