row & col

The row and col parameters define the position of the upper-left corner where the quadrille is drawn, in row and column units.

Example #

(move the mouse to position q)

code
// q0 is the reference quadrille
let q0, q;

function setup() {
  createCanvas(6 * Quadrille.cellLength, 4 * Quadrille.cellLength);
  q0 = createQuadrille(6, 4);
  q = createQuadrille(3, 58, color('blue'));
}

function draw() {
  background('orange');
  drawQuadrille(q0);
  drawQuadrille(q, { row: q0.mouseRow, col: q0.mouseCol, outline: 'lime' });
}
The mouseRow and mouseCol Quadrille properties are used to dynamically position the q quadrille based on the mouse location.

Syntax #

drawQuadrille(quadrille, { row, col })

Parameters #

ParamDescription
rowNumber: The row position of the upper-left corner in units
colNumber: The column position of the upper-left corner in units