1.0.5 • Published 4 years ago
altizure-plugin-interactive-polygon v1.0.5
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