...
Processing is a programming environment (Integrated development environment IDE) based on the programming language Java. Processing is Open Source and you can download it for free here. Solutions to common installation problems can be found here.
The Processing IDE (Integrated development environment)
The Processing IDE interface consists of three main parts. First is the text editor, this is where we can write (or paste in) our code. Then there is the Message area and the Console/error window. The Message error will show us some hints if we do something wrong, like forget to put a semicolon at the end of every line. The Console/Error window is similar in that it can display warnings, but we can also use it to output our own text for debugging as we will see in later tutorials. The final part is the Display window. This is where we see the results of our code after it is compiled, by pressing the Run button in the upper left corner.
Example 1 - Graphic output
...
Forms can also be transparent, using the alpha channel. The colour is simply extended by a 4th parameter (RGBA). Smaller alpha value are more transparent than greater ones.
...
Code Block | ||
---|---|---|
| ||
size(300,300); background(0); noStroke(); fill(210,200,200); ellipse(125,150,50,50); stroke(150,10,10); fill(100,100,90,200); beginShape(); vertex(50,50); vertex(125,150); vertex(200,50); vertex(200,200); vertex(50,200); vertex(50,50); endShape(); |
Exercise 1:
Expand and modify the examples with new or combined drawing commands (Arc, Point, Triangle, etc.).
...