x & y

The x and y parameters define the upper-left corner where the quadrille is drawn, in pixels.

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, { x: mouseX, y: mouseY, outline: 'lime' });
}

Syntax #

drawQuadrille(quadrille, { x, y })

Parameters #

ParamDescription
xNumber: The x-coordinate of the upper-left corner in pixels
yNumber: The y-coordinate of the upper-left corner in pixels