Creating functions


show more Creating functions provides you with in-depth training on Developer. Taught by Barton Poulson as part of the Interactive Data Visualization with Processing show less
please wait ...

Creating functions

One of the great ways of writing your code is to use shortcuts, such as functions. Now, we've been using a lot of functions up to this point. For instance, setup and draw and mousepress are all functions. But you can also have what are called custom or user-created functions, where you create your own shortcuts, and they allow you to use modular code, and it can save a lot of time in repeating things. So the first thing that I am going to do I this sketch is just put a little comment at the top with the sketch name.

And then I'm going to create the setup function. Let's do a void setup, small amount of text in here. I am going to do a size, 600 x 200, turn on the anti-aliasing. And I am als, going to set the frame rate to be a little slow on these. I'll leave it at 2 frames per second. So that's the first part of this sketch. I am going to save that. And then what I'm going to do is I'm not trying to create two different functions. I'll show them...

Creating functions
Video duration: 11m 48s 7h 43m Beginner

Viewers:

Creating functions provides you with in-depth training on Developer. Taught by Barton Poulson as part of the Interactive Data Visualization with Processing

Subjects:
Developer IT
Software:
Processing
Author:
please wait ...