Skip to content

Latest commit

 

History

History
54 lines (43 loc) · 1.24 KB

mouse_row.md

File metadata and controls

54 lines (43 loc) · 1.24 KB
weight draft title
1
false
mouseRow

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

{{< callout type="warning" >}} Observations

  1. The mouseRow property isn't constrain to lie in [0..[height]({{< ref "height" >}})].
  2. If the quadrille isn't currently being drawn use [screenRow]({{< ref "screen_row" >}}) instead. {{< /callout >}}

Example

{{< 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 >}}

Syntax

number = quadrille.mouseRow