Reference

Argomenti

Color | Constants | Conversion | DOM | Data | Environment | Events | IO | Image | Lights, Camera | Math | Rendering | Shape | Structure | Transform | Typography

Color

  • Creating & Reading: alpha() | blue() | brightness() | color() | green() | hue() | lerpColor() | lightness() | red() | saturation() | p5.Color
  • Setting: background() | clear() | colorMode() | fill() | noFill() | noStroke() | stroke()

Shape

  • 2D Primitives: arc() | ellipse() | line() | point() | quad() | rect() | triangle()
  • Attributes: ellipseMode() | noSmooth() | rectMode() | smooth() | strokeCap() | strokeJoin() | strokeWeight()
  • Curves: bezier() | bezierDetail() | bezierPoint() | bezierTangent() | curve() | curveDetail() | curveTightness() | curvePoint() | curveTangent()
  • Vertex: beginContour() | beginShape() | bezierVertex() | curveVertex() | endContour() | endShape() | quadraticVertex() | vertex()
  • 3D Models: loadModel() | model()
  • 3D Primitives: plane() | box() | sphere() | cylinder() | cone() | ellipsoid() | torus()

Constants

HALF_PI | PI | QUARTER_PI | TAU | TWO_PI

Structure

preload() | setup() | draw() | remove() | noLoop() | loop() | push() | pop() | redraw()


Environment

print() | frameCount | focused | cursor() | frameRate() | noCursor() | displayWidth | displayHeight | windowWidth | windowHeight | windowResized() | width | height | fullscreen() | pixelDensity() | displayDensity() | getURL() | getURLPath() | getURLParams()


DOM

p5.Element

Rendering

p5.Graphics | createCanvas() | resizeCanvas() | noCanvas() | createGraphics() | blendMode()

Transform

applyMatrix() | resetMatrix() | rotate() | rotateX() | rotateY() | rotateZ() | scale() | shearX() | shearY() | translate()

Data

  • Dictionary: p5.TypedDict | p5.NumberDict
  • Array Functions: append() | arrayCopy() | concat() | reverse() | shorten() | shuffle() | sort() | splice() | subset()
  • Conversion: float() | int() | str() | boolean() | byte() | char() | unchar() | hex() | unhex()
  • String Functions: join() | match() | matchAll() | nf() | nfc() | nfp() | nfs() | split() | splitTokens() | trim()

Events

  • Acceleration: deviceOrientation | accelerationX | accelerationY | accelerationZ | pAccelerationX | pAccelerationY | pAccelerationZ | rotationX | rotationY | rotationZ | pRotationX | pRotationY | pRotationZ | turnAxis | setMoveThreshold() | setShakeThreshold() | deviceMoved() | deviceTurned() | deviceShaken()
  • Keyboard: keyIsPressed | key | keyCode | keyPressed() | keyReleased() | keyTyped() | keyIsDown()
  • Mouse: mouseXmouseYpmouseXpmouseY | winMouseX | winMouseY | pwinMouseX | pwinMouseY | mouseButton | mouseIsPressed | mouseMoved() | mouseDragged() | mousePressed() | mouseReleased() |  mouseClicked() | doubleClicked() | mouseWheel()
  • Touch: touches | touchStarted() | touchMoved() | touchEnded()

Image

  • createImage() | saveCanvas() | saveFrames() | p5.Image
  • Loading & Displaying: loadImage() | image() | tint() | noTint() | imageMode()
  • Pixels: pixels | blend() | copy() | filter() | get() | loadPixels() | set() | updatePixels()

IO

  • Input: loadJSON() | loadStrings() | loadTable() | loadXML() | httpGet() | httpPost() | httpDo()
  • Output: createWriter() | write() | print() | flush() | close() | save() | saveJSON() | saveStrings() | saveTable() | downloadFile()
  • Table: p5.Table | p5.TableRow
  • XML: p5.XML
  • Time & Date: day() | hour() | minute() | millis() | month() | second() | year()

Math

  • createVector() | p5.Vector
  • Calculation: abs() | ceil() | constrain() | dist() | exp() | floor() | lerp() | log() | mag() | map() | max() | min() | norm() | pow() | round() | sq() | sqrt()
  • Noise: noise() | noiseDetail() | noiseSeed()
  • Random: randomSeed() | random() | randomGaussian()
  • Trigonometry: acos() | asin() | atan() | atan2() | cos() | sin() | tan() | degrees() | radians() | angleMode()

Typography

  • Attributes: textAlign() | textLeading() | textSize() | textStyle() | textWidth() | textAscent() | textDescent()
  • Loading & Displaying: loadFont() | text() | textFont()
  • Font: p5.Font

Lights, Camera

  • Camera: camera() | perspective() | ortho()
  • Lights: ambientLight() | directionalLight() | pointLight()
  • Material: loadShader() | shader() | normalMaterial() | texture() | ambientMaterial() | specularMaterial() | p5.Texture | p5.Geometry | p5.Matrix | p5.RendererGL
  • Shaders: p5.Shader