Processing Cheat Sheet
Processing Cheat Sheet
line(x1,y1,x2,y2)
point(x,y) quad(x1,y1,x2,y2,x3,y3,x4,z4) rect(x1,y1,x2,y2,radius)
triangle(x1,y1,x2,y2,x3,y3)
Time: 2D Modes: ellipseMode(CENTER/RADIUS/ CORNERS) rectMode(CENTER/RADIUS/CORNERS) smooth() - smoothens edges noSmooth() - jagged edges strokeCap(ROUND/SQUARE/PROJECT) strokeJoin(MITER/BEVEL/ROUND) strokeWeight(weight) Monitor: print() - prints without linespace printArray() - print array values Mouse: mouseButton - LEFT/RIGHT/CENTER mouseClicked() - calls a function when mouse is clicked mouseDragged() - calls a function when mouse is dragged mouseMoved() - calls function when mouse is moved mousePressed() - calls function when mouse is pressed mousePressed - variable for mouse press mouseReleased() - calls a function when mouse is released Images: PImage img - define image name loadImage() - gets image image(img,width,height) tint(r,g,b,alpha) - image transparency println() - print with linespace day() - returns day 1-31 hour() - returns hour 0-23 minute() - returns minutes 0-59 month() - returns month 1-12 second() - returns seconds 0-59 year() - returns year
Environment:
cursor() - changes cursor i.e.: (HAND,ARROW,CROSS,MOVE,TEXT,WA IT) displayHeight - returns monitor height displayWidth - returns monitor width height - returns window height width - returns window width frameRate(int) - specifies frame rate frameCount - returns number of frames counted frameRate - returns frame rate
Font:
PFont font - define font name loadFont() - calls declared font
mouseButton - variable for mouse button createFont(Font, size) - stores font to a variable mouseX - returns mouse x value mouseY - returns mouse y value pmouseX - previous mouse X pmouseY - previous mosue Y textFont() - applies font text(string, x1, y1, x2, y2) textAlign() - LEFT/CENTER/RIGHT
CONTROL,SHIFT,BACKSPACE,TAB,ENTER,
RETURN,ESC,DELETE