.. role:: ts-api-decorator

#######
Polygon
#######

.. js:module:: Markup.Shapes
   :noindex:

.. container:: ts-api-section

   .. js:class:: Polygon

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



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Markup.Shapes.Polygon.constructor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Markup.Shapes.Polygon.clearPoints`
   * :js:meth:`~Markup.Shapes.Polygon.getFillColor`
   * :js:meth:`~Markup.Shapes.Polygon.getFillOpacity`
   * :js:meth:`~Markup.Shapes.Polygon.getPoints`
   * :js:meth:`~Markup.Shapes.Polygon.getStrokeColor`
   * :js:meth:`~Markup.Shapes.Polygon.getStrokeWidth`
   * :js:meth:`~Markup.Shapes.Polygon.pushPoint`
   * :js:meth:`~Markup.Shapes.Polygon.setFillColor`
   * :js:meth:`~Markup.Shapes.Polygon.setFillOpacity`
   * :js:meth:`~Markup.Shapes.Polygon.setStrokeColor`
   * :js:meth:`~Markup.Shapes.Polygon.setStrokeWidth`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: Polygon.constructor()



      :rtype: Polygon



Methods
=======

.. rst-class:: ts-api-section

clearPoints
-----------

.. js:method:: Polygon.clearPoints()



   Removes all points from this polygon


   :rtype: void

.. rst-class:: ts-api-section

getFillColor
------------

.. js:method:: Polygon.getFillColor()



   Gets the fill color for this shape

   :returns: the fill color


   :rtype: Color

.. rst-class:: ts-api-section

getFillOpacity
--------------

.. js:method:: Polygon.getFillOpacity()



   Gets the fill opacity for this shape

   :returns: the fill opacity


   :rtype: number

.. rst-class:: ts-api-section

getPoints
---------

.. js:method:: Polygon.getPoints()



   Gets the points in this polyline

   :returns: the points in this polygon


   :rtype: [Point2]

.. rst-class:: ts-api-section

getStrokeColor
--------------

.. js:method:: Polygon.getStrokeColor()



   Gets the stroke color for this shape

   :returns: the stroke color


   :rtype: Color

.. rst-class:: ts-api-section

getStrokeWidth
--------------

.. js:method:: Polygon.getStrokeWidth()



   Gets the stroke width for this shape in pixels

   :returns: the stroke width in pixels


   :rtype: number

.. rst-class:: ts-api-section

pushPoint
---------

.. js:method:: Polygon.pushPoint( point)

   :param point: the point to add to the polygon
   :type point: Point2


   Adds a point to the polygon


   :rtype: void

.. rst-class:: ts-api-section

setFillColor
------------

.. js:method:: Polygon.setFillColor( color)

   :param color: the fill color
   :type color: Color


   Sets the fill color for this shape


   :rtype: void

.. rst-class:: ts-api-section

setFillOpacity
--------------

.. js:method:: Polygon.setFillOpacity( fillOpacity)

   :param fillOpacity: the fill opacity
   :type fillOpacity: number


   Sets the fill opacity for this shape


   :rtype: void

.. rst-class:: ts-api-section

setStrokeColor
--------------

.. js:method:: Polygon.setStrokeColor( color)

   :param color: the stroke color
   :type color: Color


   Sets the stroke color for this shape


   :rtype: void

.. rst-class:: ts-api-section

setStrokeWidth
--------------

.. js:method:: Polygon.setStrokeWidth( strokeWidth)

   :param strokeWidth: the stroke width in pixels
   :type strokeWidth: number


   Sets the stroke width for this shape in pixels


   :rtype: void

