Examples
import { vertices } from '@wimaengine/render-canvas2d'
const path = new Path2D()
vertices(path, [0, 0, 10, 0, 10, 10])Function
vertices(ctx: CanvasRenderingContext2D | Path2D, vertices: ArrayLike<number>, close?: boolean): voidBuilds a path from flat coordinate pairs on a Canvas 2D drawing target.
The target may be a CanvasRenderingContext2D or Path2D.
Values are consumed as [x, y] pairs: the first pair is passed to moveTo,
and each later pair is passed to lineTo. Fewer than two values return
without changing the target. When close is true, the default, the
helper adds a final line segment back to the first pair; passing false
leaves the path open.
import { vertices } from '@wimaengine/render-canvas2d'
const path = new Path2D()
vertices(path, [0, 0, 10, 0, 10, 10])