Image Display

imageDisplay #

Static method for drawing cells that are filled with p5.Image or p5.Graphics instances.

Used by drawQuadrille and sample.

Example #

code
let al;

function preload() {
  al = loadImage('abraham_lincoln.jpg');
}

function setup() {
  createCanvas(165, 165);
}

function draw() {
  background('blue');
  Quadrille.imageDisplay({ graphics: this, value: al, cellLength: width });
}

Syntax #

Quadrille.imageDisplay({graphics, value, [cellLength]})

Parameters #

parameterdescription
graphicsp5.Graphics: renderer target
valuep5.Color: cell contents
cellLengthNumber: edge length in pixels default is Quadrille.cellLength