Statements and Comments
Coordinates
Width and Height
Setup and Draw
No Loop
Loop
Redraw
Functions
Recursion
Recursion 2
CreateGraphics
Points and Lines
Shape Primitives
Simple Curves
Pie Chart
Vertices
Triangle Strip
Bezier
Bezier Ellipse
Variables
Integers and Floats
True/False
Characters and Strings
Datatype Conversion
Variable Scope
Iteration
Embedded Iteration
Conditionals 1
Conditionals 2
Logical Operators
Load and Display Image
Background Image
Transparency
Sprite
Alphamask
CreateImage
RequestImage
Pointillism
Load and Display Shape
Disable Style
Scale Shape
Get Child
Letters
Words
Hue
Saturation
Brightness
Color Wheel
Reading
Creating
Relativity
Linear Gradient
Radial Gradient
Wave Gradient
Increment/Decrement
Operator Precedence
Modulo
Distance 1D
Distance 2D
Sine
Sine and Cosine
Sine Wave
Additive Wave
Polar to Cartesian
Arctangent
Graphing 2D Equation
Random
Double Random
Noise 1D
Noise 2D
Noise 3D
NoiseWave
Mouse 1D
Mouse 2D
MousePress
Mouse Signals
Easing
Constrain
Storing Input
Mouse Functions
Keyboard
Keyboard Functions
Milliseconds
Clock
Translate
Scale
Rotate
Triangle Flower
Arm
Array
Array 2D
Array Objects
Objects
Multiple Constructors
Composite Objects
Inheritance
Neighborhood
Embedded Links
Loading Images
This example is for Processing version 1.0+. If you have a previous version, use the examples included with your software. If you see any errors or have comments, please let us know .
Milliseconds.
A millisecond is 1/1000 of a second. Processing keeps track of the number of milliseconds a program has run. By modifying this number with the modulo(%) operator, different patterns in time are created.
float scale;
void setup()
{
size(200, 200);
noStroke();
scale = width/10;
}
void draw()
{
for(int i=0; i<scale; i++) {
colorMode(RGB, (i+1) * scale * 10);
fill(millis()%((i+1) * scale * 10) );
rect(i*scale, 0, scale, height);
}
}