weight | draft | title |
---|---|---|
1 |
false |
mouseRow |
Read-only property that retrieves the quadrille row under the current mouse position.
{{< callout type="warning" >}} Observations
- The
mouseRow
property isn't constrain to lie in [0..[height]({{< ref "height" >}})]. - If the quadrille isn't currently being drawn use [screenRow]({{< ref "screen_row" >}}) instead. {{< /callout >}}
{{< p5-global-iframe quadrille="true" width="425" height="425" >}}
use strict
;
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); } {{< /p5-global-iframe >}}
{{< details title="code" open=false >}}
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);
}
{{< /details >}}
number = quadrille.mouseRow