0% found this document useful (0 votes)
520 views

Processing Cheat Sheet: Print (String)

This cheat sheet summarizes key concepts and functions for Processing, an open-source programming language and environment for visual arts. It covers basic structure and functions, shapes, geometry, colors, variables, logic, and time/date functions. The cheat sheet is intended to provide a concise overview of essential Processing concepts in 3 pages or less.

Uploaded by

chesterpeters
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
520 views

Processing Cheat Sheet: Print (String)

This cheat sheet summarizes key concepts and functions for Processing, an open-source programming language and environment for visual arts. It covers basic structure and functions, shapes, geometry, colors, variables, logic, and time/date functions. The cheat sheet is intended to provide a concise overview of essential Processing concepts in 3 pages or less.

Uploaded by

chesterpeters
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PROCESSING CHEAT SHEET

Content for this cheat sheet provided from http://www.surattack.com


Additional resources can be found at: http://www.processing.org/

Structure Basic Functions Shapes Border, Stroke, & Fill Basic Geometry
void setup() size(width, height); fill(red,green,blue); Anchor point
{ // runs only once. Sets main window size in pixels. Sets the filling color for next shape to draw
} background(color); 0-255.
void draw() Sets window background color.. noFill();
{ // runs repeatedly. frameRate(fps); Disables filling for the next shape.
Sets the applications FPS. stroke(Red,Green,Blue);
}
print(string); Sets the stroke/border color for next shape
Writes a string to the Console. to draw 0-255.
ellipse(x,y, w,h);
println(string); noStroke();
Comments/Debug Draws an ellipse centered in positiion (x,y)
Disables border for the next shape as well
/* this is a multiline Writes a string to the Console with a
as lines.
and with size “width”(w) and “height”(h).
comment. nothing between CRLF.
here will be run or
executed */ delay(milliseconds); Coordinate System
// this is a single Places a wait or delay in
// line comment milliseconds.
rect(x, y, w, h);
Draws a rect anchored at the top left
Data \ Variable Types Global Variables corner, in position (x, y) and with a size
void (null return) width: Returns sketch’s width in pixels. “width” (w) and “height” (h).
int (integer -32,768 to 32,767) height: Returns sketch’s height in
float (floating point / decimal numbers) pixels
String (array of characters) mouseX, mouseY : Returns the
current mouse pointer’s X or Y axis
coordinate
Conditional Operators pmouseX, pmouseY : Returns line(x1, y1, x2, y2);
previous mouse pointer’s X or Y axis Draws a line from (x1, y1) to (x2, y2)
coordinate
frameCount : Return’s sketch’s Top left corner of each sketch is the (0,0)
current frame. point. That axis changes when we make Time & Date
Basic Logic frameRate : Returns sketch’s current use of the translate() function. day();
If(mathematical statement) FPS.
{ Returns the numeric day of the
//true statement code here month.
Minimum measurement unit in a computer hour();
}
Other shapes screen is a Pixel.
else Returns the current hour.
{
point(x1, y1);
triangle(x1, y1, x2, y2, minute();
//false statement code here
x3, y3); Returns the current minute.
}
quad(x1, y1, x2, y2, x3, second();
y3, x4, y4); Returns the current second.
rev 0.2

You might also like