Width

width #

Quadrille width read-write property.

Example #

(mouse click or press any key)

code
Quadrille.cellLength = 50;
let quadrille;

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

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

function mouseClicked() {
  // property write
  quadrille.width = int(random(1, 9));
  quadrille.rand(int(quadrille.size * 0.6), '🐒');
}

function keyPressed() {
  // property write
  quadrille.width = int(random(1, 9));
  quadrille.rand(int(quadrille.size * 0.6), '🐒');
}

Syntax #

quadrille.width = number

number = quadrille.width