- Processing
- p5.js
- Processing.py
- Processing for Android
- Processing for Pi

- Processing Foundation

This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

Name | ### texture()
Examples |
    size(100, 100, P3D);
    noStroke();
    PImage img = loadImage("laDefense.jpg");
    beginShape();
    texture(img);
    vertex(10, 20, 0, 0);
    vertex(80, 5, 100, 0);
    vertex(95, 90, 100, 100);
    vertex(40, 95, 0, 100);
    endShape();
Description | Sets a texture to be applied to vertex points. The texture() function must be called between beginShape() and endShape() and before any calls to vertex(). This function only works with the P2D and P3D renderers. When textures are in use, the fill color is ignored. Instead, use tint() to specify the color of the texture as it is applied to the shape.
Syntax |
    texture(image)
Parameters |
image | PImage: reference to a PImage object
Returns | void
Related | textureMode() textureWrap() beginShape() endShape() vertex()

Updated on July 4, 2018 11:56:43am EDT