SketchAPI
SketchAPI copied to clipboard
Ability to specify number of points of a polygon
Doesn’t seem like there is an easy way to change the number of sides of a polygon. Similar with the Star object, there should be a way with the API to set the number of points and the radius.
let sketch = require('sketch')
let document = sketch.getSelectedDocument()
let page = document.selectedPage
let ShapePath = sketch.ShapePath
let myHex = new ShapePath({
shapeType: ShapePath.ShapeType.Polygon,
parent: page,
frame: { x: 218, y: 142, width: 120, height: 120 },
style: { fills: ['#FF00B3']}
})
myHex.sketchObject.setNumberOfPoints(8)
setNumberOfPoints does seem to change the slider but doesn’t update the object properly.