-
Notifications
You must be signed in to change notification settings - Fork 0
3.4 Polygon
Jonas de Luna Skulberg edited this page Jun 26, 2024
·
3 revisions
- vertices: InputPosition, InputPosition, InputPosition, ...InputPosition[]
-
color?: number
Color of the Polygon fill. -
fill?: boolean
Whether the Polygon should be filled. -
opacity?: number
Opacity of the Polygon fill. -
draggable?: Draggable
Whether the Polygon should be draggable. -
dragListeners?: ((point: Polygon) => void)[]
Initial dragListeners that can be added upon construction of the Polygon. -
hasOutline: boolean
Whether he Polygon should have an outline
color: 0xfaa307,
opacity: 0.6,
draggable: undefined,
dragListeners: [],
hasOutline: true,
collidesWith(other: Object3D): boolean
distanceTo(other: Object3D<Event>): number
-
addDragListener(listener: (point: Point) => void)
Adds a draglistener to the polygon. The parameter of the listenerfunction takes in a reference to the instance of the polygon the listener is attached to.
-
setPosition(position: InputPosition)
Set the position of the polygon to a specified center position. -
setVertices(newVertices: PolygonVertices)
Sets a new set of points and updates the polygon.