O'Reilly logo

Getting Started with Processing by Ben Fry, Casey Reas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Functions

Functions are the basic building blocks for Processing programs. They have appeared in every example we've presented. For instance, we've frequently used the size() function, the line() function, and the fill() function. This chapter shows how to write new functions to extend the capabilities of Processing beyond its built-in features.

The power of functions is modularity. Functions are independent software units that are used to build more complex programs—like LEGO® bricks, where each type of brick serves a specific purpose, and making a complex model requires using the different parts together. As with functions, the true power of these bricks is the ability to build many different forms from the same set of elements. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required