Polygon

class Markup.Shapes.Polygon()

This class represents a shape bounded by the polyline formed from its points.

Constructors


Constructors

Polygon.constructor()
Return type:Polygon

Methods

clearPoints

Polygon.clearPoints()

Removes all points from this polygon

Return type:void

getFillColor

Polygon.getFillColor()

Gets the fill color for this shape

Returns:the fill color
Return type:Color

getFillOpacity

Polygon.getFillOpacity()

Gets the fill opacity for this shape

Returns:the fill opacity
Return type:number

getPoints

Polygon.getPoints()

Gets the points in this polyline

Returns:the points in this polygon
Return type:[Point2]

getStrokeColor

Polygon.getStrokeColor()

Gets the stroke color for this shape

Returns:the stroke color
Return type:Color

getStrokeWidth

Polygon.getStrokeWidth()

Gets the stroke width for this shape in pixels

Returns:the stroke width in pixels
Return type:number

pushPoint

Polygon.pushPoint(point)
Arguments:
  • point (Point2()) – the point to add to the polygon

Adds a point to the polygon

Return type:void

setFillColor

Polygon.setFillColor(color)
Arguments:
  • color (Color()) – the fill color

Sets the fill color for this shape

Return type:void

setFillOpacity

Polygon.setFillOpacity(fillOpacity)
Arguments:
  • fillOpacity (number()) – the fill opacity

Sets the fill opacity for this shape

Return type:void

setStrokeColor

Polygon.setStrokeColor(color)
Arguments:
  • color (Color()) – the stroke color

Sets the stroke color for this shape

Return type:void

setStrokeWidth

Polygon.setStrokeWidth(strokeWidth)
Arguments:
  • strokeWidth (number()) – the stroke width in pixels

Sets the stroke width for this shape in pixels

Return type:void