Mouse Row

mouseRow #

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

Observations

  1. The mouseRow property isn’t constrain to lie in [0..height].
  2. If the quadrille isn’t currently being drawn use screenRow instead.

Example #

code
Quadrille.cellLength = 50;
let quadrille;

function setup() {
  createCanvas(8 * Quadrille.cellLength, 8 * Quadrille.cellLength);
  quadrille = createQuadrille(int(random(1, 9)), int(random(1, 9)));
}

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

Syntax #

number = quadrille.mouseRow