mouseCol

Read-only property that retrieves the quadrille col under the current mouse position.

  1. The mouseCol property isn’t constrain to lie in [0..width].
  2. If the quadrille isn’t currently being drawn use screenCol instead.

Example #

code
Quadrille.cellLength = 50;
let quadrille;

function setup() {
  createCanvas(8 * Quadrille.cellLength, 8 * Quadrille.cellLength);
  quadrille = createQuadrille(4, 8);
}

function draw() {
  background('#6495ED');
  drawQuadrille(quadrille);
  text('mouseCol: ' + quadrille.mouseCol, 20, 20);
}

Syntax #

number = quadrille.mouseCol