shift(dRow, dCol, wrap)
Shifts cells by a row/column offset. Returns this quadrille (chainable).
dRowmoves down when positive; up when negative.dColmoves right when positive; left when negative.- With
wrapon (default) it wraps around; withwrapoff it slides, leaving empty cells behind.
Note
For a non-destructive static version, call
Quadrille.shift(q, dRow, dCol, wrap).
Example
(drag to shift; press any key to reset)
Syntax
shift(dRow, dCol, [wrap = true])
Parameters
| Param | Description |
|---|---|
dRow |
Number. Rows to move: positive down, negative up |
dCol |
Number. Columns to move: positive right, negative left |
wrap |
Boolean (default true). When on, the grid wraps around; when off, it slides and leaves empty spaces |
What this page's examples use
- p5.quadrille
drawQuadrillecreateQuadrillecellLengthmouseRowmouseColoutlineWeightisValidshift- p5.js
createCanvasbackgroundpositioncreateCheckboxcheckedstyle
Names the analysis can prove are called, and the line each one is documented on. Local variables and members of an unknown receiver are left out.