Language \ Environment \ Comparison
 
  Language (API). The Processing Language has been designed to facilitate the creation of sophisticated visual and conceptual structures.
 
 
Select a different language:
Indonesian
Japanese


In progress:
Chinese
French
Hebrew

Italian
Korean
Spanish
Turkish


The reference on this page is only valid for the current Processing release. If you are using a different version of the software consult the reference included with your release.

If you would like to translate the reference to a different language, please contact reas at groupc.net


Basic Syntax

size()
; (semicolon)
= (assign)
() (parentheses)
, (comma)
// (comment)
/* */ (multiline comment)
void
setup()
loop()
new
{} (curly braces)
[](array access)
. (dot)



Environment

width
height
framerate()
delay()
smooth()

noSmooth()
cursor()
noCursor()
save()
saveFrame()



Data

Primitive
int
float
char
byte
boolean
color

Composite
String
Array
Object

Conversion
int()
float()
char()
byte()

Parsing
splitInts()
splitFloats()
splitStrings()
join()
sort()

Formatting
nf()



Control

Relational Operators
> (greater than)
< (less than)
>= (greater than or equal to)
<= (less than or equal to)
== (equality)
!= (inequality)

Iteration
while()
for()

Conditionals
if()
else

Logical operators
|| (logical OR)
&& (logical AND)
!
(logical NOT)





Shape

2D Primitives
point()
line()
triangle()
quad()
rect()
rectMode()
ellipse()
ellipseMode()
curve()
bezier()

3D Primitives
box()
sphere()

Stroke attributes
strokeWeight()

Vertex
beginShape()
endShape()
vertex()
curveVertex()
bezierVertex()



Input/Output

Mouse
mouseX
mouseY
pmouseX
pmouseY
mousePressed
mousePressed()
mouseReleased()
mouseMoved()
mouseDragged()

Keyboard
keyPressed
key
keyPressed()
keyReleased()

Time & Date
millis()
second()
minute()
hour()
day()
month()
year()

Text Output
print()
println()

Files

loadStrings()
loadBytes()
saveStrings()
saveBytes()


Web
link()
param()
status()
online()



Image

Loading & Displaying
BImage
loadImage()
image()
imageMode()
tint()
noTint()
background()

Pixels
get()
set()
copy()
pixels[]



Typography

BFont
loadFont()
textFont()
textSize()
text()
textMode()



Lights & Camera

Lights
lights()
noLights()

Camera

screenX()
screenY()
screenZ()

Color

Setting
background()
stroke()
noStroke()
fill()
noFill()
colorMode()

Creating & Reading
color()
red()
green()
blue()
hue()
saturation()
brightness()



Transform

translate()
rotate()
rotateX()
rotateY()
rotateZ()
scale()
push()
pop()



Math

Operators
+ (add)
- (subtract)
* (multiply)
/ (divide)
++ (increment)
-- (decrement)
% (modulo)
+= (add assign)
-= (subtract assign)
- (negation)

Basic
abs()
sq()
sqrt()
pow()
max()
min()
ceil()
floor()
dist()
constrain()

Trigonometry
sin()
cos()
tan()
atan2()
radians()
degrees()

Random
random()
noise()



Constants

PI (3.14159...)
TWO_PI (6.28318...)
HALF_PI ( 1.57079...)



Image

Libraries extend the basic functionality of Processing. It is possible to write your own libraries.

Serial
Supports communication between Processing and external hardware via the serial port.


Sonia by Amit Pitaru
Advanced audio library for playback and synthesis. Integrates Jsyn and requires a plugin for playback.

Video
Interface to Apple QuickTime for using a camera and playing movie files.

Sound (In progress)
Basic audio library for sample playback.


Network (In progress)
Sending and receiving data over the Internet. Allows creation of simple clients and servers.



Future libraries may include:
DXF Import/Export
GUI
MIDI
Open Sound Control

XML Parser



   
© 2004 - 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas