top of page

Functions List

popMatrix
Pops the current transformation matrix of the matrix stack. PopMatrix can be used along with PushMatrix, in conjunction with the other transformation functions and embedded to control the scope of the transformation

popMatrix():

pushMatrix
Pushes the current transformation matrix onto the matrix stack. Can be used in my final text project to be used in conjunction with the other transformation functions and embedded to control the scope of the transformation

pushMatrix():

createGraphics
Creates and returns a new PGraphics object. Unlike the main drawing surface which is completely opaque, any surface that is created with createGraphics() can have transparency. This makes it possible to draw into a graphic and maintain the alpha channel.

createGraphics():

printArray
Writes array data to the text area of the Processing environment's console. With each element of the array, a new line is put in between. This function can only be used to print one-dimensional arrays.

printArray():

PFont
The font class for Processing. It is used to create a font to use with Processing. PFont must be declared first before using createFont().

PFont:

text
Draws text to the screen. A default font will be used unless a font is set with the textFont() function and a default size will be used unless a font is set with textSize(). Using text(), you can change the colour, size, font and alignment of the text using other text-related functions.

text():

textSize
Sets the current font size.

textSize():

textAlign
Sets the current alignment for drawing text. The parameters LEFT, CENTER, and RIGHT set the display characteristics of the letters in relation to the x and y values for the parameters of the text() function.

textAlign():

textFont
Sets the current font that will be drawn with the text() function. Fonts must be created for Processing with createFont() or loaded with loadFont().

textFont():

triangle, rect, ellispe
Draws a triangle, rectangle or ellipse to the screen. 
triangle(): A triangle is a place created by connecting three points. the first two arguments specify the first point, the middle two specify the second point and the last two arguments specify the third point.
rect(): A rectangle is a four-sided shape with every angle at ninety degrees. You are also able to draw a rounded rectangle by adding a fifth parameter with the radius value for all four corners.
ellipse(): An ellipse with equal width and height is a circle. The first two parameters set the location while the third and fourth parameters set the shape's width and height.

triangle(), rect() and ellispe()

int
Converts any value of a primitive data type (eg boolean, float, color) to its integer representation. When an array of values is passed in, then an int array of the same length is returned.

int:

string
A string is a sequence of characters. Strings are always defined inside double quotes ("ABC"), and characters are always defined inside single quotes ('A').

string:

strokeCap
Sets the style for rendering lines. These ends are either squared, extended, or rounded. Each of which is specified with the corresponding parameters SQUARE, PROJECT, and ROUND. The default cap is ROUND.

strokeCap():

imageMode
Modifies the location from which images are drawn by changing the way the parameters given to image() are interpreted. These modes are CORNER, CORNERS and CENTER. CORNER  is the default mode which interprets the second and third parameters of image() as the upper-left corner of the image. CORNERS interprets the second and third parameter of image() as the location of one corner and the fourth and fifth parameters as the opposite corner. CENTER interprets the second and third parameters of image() as the image's center point.

imageMode():

rotate
Rotates the amount specified by the angle parameter. Angles must be specified in radians or they can be converted from degrees to radians with the radians() function. The coordinates are always rotated around their relative position to the origin. Positive numbers rotate objects in a clockwise direction while negative numbers rotate in the counterclockwise direction. rotate() multiplies the current transformation matrix by a rotation matrix. This function can be further controlled by pushMatrix() and popMatrix().

rotate():

PImage
Datatype for storing images. Images may be displayed in 2d and 3D space. Before an image is used, it must be loaded with the loadImage() function. The PImage class contains fields for the width and height of the image as well as an array called pixels[].

PImage:

loadImage
Loads an image into a variable of type PImage. The four types of images that may be loaded include .gif, .jpg, .tga and .png. Images must be located in the data directory of the current sketch in order for it to load correctly.

loadImage():

translate
Pushes the current transformation matrix onto the matrix stack. Can be used in my final text project to be used in conjunction with the other transformation functions and embedded to control the scope of the transformation

translate():

random
Generates random numbers. When the random() function is called on, it returns an unexpected value within the specified range. For example, random(-30,60) has two parameters that are specified. The function will return a float with a value starting at -30 and up to (but not including) 60. If one parameter is passed to the function such as random(10), it will return a float between 0 and 10 (starting at 0, and up to, but not including,5)

random():

keyPressed
This function is called once every time a key is pressed. The key that is pressed is stored in the key variable.

keyPressed():

directionalLight
Adds a directional light. After hitting a surface, directional light scatters in all directions and are weaker if it hits at a gentle angle.

directionalLight():

line
Draws a line (a direct path between two points) to the screen.

line():

sphere
A sphere is a hollow ball made from tessellated triangles

sphere():

Reference: Processing.org. n.d. Language Reference (API) \ Processing 3+. [online] Available at: <https://processing.org/reference/> [Accessed 28 May 2020].
bottom of page