0% found this document useful (0 votes)
224 views1 page

Processing Cheat Sheet

This document provides a cheat sheet for common processing functions organized into categories including basic functions, time, mouse, images, environment, fonts, shapes, and keyboard. It lists functions such as setup(), draw(), mouseX(), loadImage(), background(), stroke(), text(), and key() along with their parameters and purposes like initializing the sketch, controlling the draw loop, getting mouse position, loading images, setting colors, drawing text, and detecting key presses.
Copyright
© Attribution Non-Commercial (BY-NC)
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)
224 views1 page

Processing Cheat Sheet

This document provides a cheat sheet for common processing functions organized into categories including basic functions, time, mouse, images, environment, fonts, shapes, and keyboard. It lists functions such as setup(), draw(), mouseX(), loadImage(), background(), stroke(), text(), and key() along with their parameters and purposes like initializing the sketch, controlling the draw loop, getting mouse position, loading images, setting colors, drawing text, and detecting key presses.
Copyright
© Attribution Non-Commercial (BY-NC)
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

line(x1,y1,x2,y2)
point(x,y) quad(x1,y1,x2,y2,x3,y3,x4,z4) rect(x1,y1,x2,y2,radius)

Basic: exit() - gets out of the program draw() - starts loop

keyPressed() - calls a function when key is pressed


keyPressed - returns true/false keyReleased - returns true/false

setup() - initial set-up


loop() - turns draw loop on noLoop() - turns off draw loop redraw() - replays loop

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

pushStyle() - starts a new style


popStyle() - returns to previous style Settings:

background() - sets background


clear() - clear screen fill() - define fill color noFill() - removes fill

color() - variable for color


stroke() - define stroke color noStroke() - removes stroke

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

size(width,height) - specifies window size


size(width,height,P3D) - allows 3D rendering Shapes in 2D arc(x,y,width,height,start,stop) ellipse(x,y,width,height) Keyboard: key - returns key released or pressed keyCode - UP,DOWN,LEFT,RIGHT,ALT,

textLeading() - sets text distances


textSize() - sets text size

CONTROL,SHIFT,BACKSPACE,TAB,ENTER,
RETURN,ESC,DELETE

You might also like