import { Point } from 'pixi.js' ; import { IGraphicOption , setCommonOption } from './option' ; interface IPolygonParam { path : Array < { x : number ; y : number ; } > ; } export function drawPolygon ( graphic , param , option ? ) { setCommonOption ( graphic , option ) ; const points = param . path . map ( p => new Point ( p . x , p . y ) ) ; graphic . drawPolygon ( points ) ; graphic . endFill ( ) ; }