tsunagiDrawingfunction
A board as pieces, for a page that keeps its drawing in a framework's tree and writes only what changed: the same
drawing as drawTsunagi, which is this written out.
Import it
import { tsunagiDrawing } from "@johnmorrisdotca/tsunagi/draw";
Definition
function tsunagiDrawing(layout: LinkLayout, options?: TsunagiDrawOptions): TsunagiDrawing
Parameters
| Name | Type | Description |
|---|---|---|
layout | LinkLayout | The decoded native board and its rule settings. |
options (optional) | TsunagiDrawOptions | Native drawing, geometry, game or mount settings. |
Returns
TsunagiDrawing
The <svg>'s attributes, the custom properties its board sets, and its groups in painting order.
Examples
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { decodeLayout } from "@johnmorrisdotca/tsunagi";
import { tsunagiDrawing } from "@johnmorrisdotca/tsunagi/draw";
const layout = decodeLayout(TSUNAGI_4[0][0],4)!;
console.log(tsunagiDrawing(layout,{surface:true}).pieces.length);10What it prints (run when this page was built)