ABSTRACT

This chapter describes about creating own void functions, which do not return a value. Active mode includes the special void function setup(), which is automatically called once by Processing as soon as it start running the program. A function is created by defining its header and its body. A function can be reused by calling the function multiple times. The chapter explains parameter variables for a function so that specific values can be passed to that function as arguments. Processing's special draw() function is automatically called repeatedly by Processing, as soon as the performance of the setup() function is completed. The mouseX and mouseY variables keep track of the current position of the mouse pointer over the canvas when the draw() function is used. Processing provides other special functions that can be used if the draw() function is defined: includes the mousePressed() and keyPressed() functions that are automatically called by Processing when the corresponding mouse or keyboard event takes place.