className | :x: | String | ClassName for canvas parent ref |
style | :x: | Object | Styles for canvas parent ref |
setup | :heavy_check_mark: | Function | The setup() function is called once when the program starts. |
draw | :x: | Function | Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called. |
windowResized | :x: | Function | The windowResized() function is called once every time the browser window is resized. |
preload | :x: | Function | Called directly before setup(), the preload() function is used to handle asynchronous loading of external files in a blocking way. |
mouseClicked | :x: | Function | The mouseClicked() function is called once after a mouse button has been pressed and then released. |
mouseMoved | :x: | Function | The mouseMoved() function is called every time the mouse moves and a mouse button is not pressed. |
doubleClicked | :x: | Function | The doubleClicked() function is executed every time a event listener has detected a dblclick event which is a part of the DOM L3 specification. |
mousePressed | :x: | Function | The mousePressed() function is called once after every time a mouse button is pressed. |
mouseWheel | :x: | Function | The function mouseWheel() is executed every time a vertical mouse wheel event is detected either triggered by an actual mouse wheel or by a touchpad. |
mouseDragged | :x: | Function | The mouseDragged() function is called once every time the mouse moves and a mouse button is pressed. If no mouseDragged() function is defined, the touchMoved() function will be called instead if it is defined. |
mouseReleased | :x: | Function | The mouseReleased() function is called every time a mouse button is released. |
keyPressed | :x: | Function | The keyPressed() function is called once every time a key is pressed. The keyCode for the key that was pressed is stored in the keyCode variable. |
keyReleased | :x: | Function | The keyReleased() function is called once every time a key is released. See key and keyCode for more information. |
keyTyped | :x: | Function | The keyTyped() function is called once every time a key is pressed, but action keys such as Backspace, Delete, Ctrl, Shift, and Alt are ignored. |
touchStarted | :x: | Function | The touchStarted() function is called once after every time a touch is registered. |
touchMoved | :x: | Function | The touchMoved() function is called every time a touch move is registered. |
touchEnded | :x: | Function | The touchEnded() function is called every time a touch ends. If no touchEnded() function is defined, the mouseReleased() function will be called instead if it is defined. |
deviceMoved | :x: | Function | The deviceMoved() function is called when the device is moved by more than the threshold value along X, Y or Z axis. The default threshold is set to 0.5. The threshold value can be changed using setMoveThreshold() |
deviceTurned | :x: | Function | The deviceTurned() function is called when the device rotates by more than 90 degrees continuously. |
deviceShaken | :x: | Function | The deviceShaken() function is called when the device total acceleration changes of accelerationX and accelerationY values is more than the threshold value. The default threshold is set to 30. |