altizure-plugin-interactive-polygon
v1.0.5
Published
javascript``` const canvas = new altizurePluginInteractivePolygon.Canvas({ canvas: document.getElementById('canvas'), sandbox })
Downloads
8
Readme
This is an simple example
javascript``` const canvas = new altizurePluginInteractivePolygon.Canvas({ canvas: document.getElementById('canvas'), sandbox })
const polygon = canvas.addPolygon()
let points = []
polygon.once('close', () => { points = polygon.vertices.map(vertex => vertex.position) // [{ x, y }] })
polygon.draw() // start drawing with user interaction
canvas.clear() // remove all its child
canvas.destruct() // remove all its child and listeners