Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 1.18 KB

cell_length.md

File metadata and controls

56 lines (45 loc) · 1.18 KB
weight draft title
1
false
cellLength

Defines the quadrille default drawing cell length in pixels. Default is 100.

Used by [drawQuadrille]({{< ref "draw_quadrille" >}}).

Example

{{< p5-global-iframe quadrille="true" width="425" height="425" >}} use strict; Quadrille.cellLength = 55; let quadrille; let lengthSlider;

function setup() { createCanvas(400, 400); quadrille = createQuadrille(4, 4); lengthSlider = createSlider(10, 100, Quadrille.cellLength, 5); lengthSlider.position(10, height - 20); lengthSlider.input(() => Quadrille.cellLength = lengthSlider.value()); }

function draw() { background('orange'); drawQuadrille(quadrille); } {{< /p5-global-iframe >}}

{{< details title="code" open=false >}}

Quadrille.cellLength = 55;
let quadrille;
let lengthSlider;

function setup() {
  createCanvas(400, 400);
  quadrille = createQuadrille(4, 4);
  lengthSlider = createSlider(10, 100, Quadrille.cellLength, 5);
  lengthSlider.position(10, height - 20);
  lengthSlider.input(() => Quadrille.cellLength = lengthSlider.value());
}

function draw() {
  background('orange');
  drawQuadrille(quadrille);
}

{{< /details >}}

Syntax

Quadrille.cellLength