String Display

string #

Static method for drawing cells that are filled with colors.

Used by drawQuadrille and sample.

Example #

code
let string;

function setup() {
  createCanvas(180, 180);
  string = createInput('hola');
}

function draw() {
  background('tomato');
  Quadrille.stringDisplay({ graphics: this, value: string.value(),
                            cellLength: width, textZoom: 0.65 });
}

Syntax #

Quadrille.stringDisplay({graphics, value, [cellLength], [textColor], [textZoom]})

Parameters #

parameterdescription
graphicsp5.Graphics: renderer target
valuep5.Color: cell contents
cellLengthNumber: edge length in pixels default is Quadrille.cellLength
textColorp5.Color representation: text color default is Quadrille.textColor
textZoomNumber:: text zoom level default is Quadrille.textZoom