.. role:: ts-api-decorator

#########
Rectangle
#########

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

.. container:: ts-api-section

   .. js:class:: Rectangle

      Represents a rectangle defined by a position and a size.



.. container:: api-index-section

   .. rubric:: Constructors

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

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



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Markup.Shapes.Rectangle.getBorderRadius`
   * :js:meth:`~Markup.Shapes.Rectangle.getFillColor`
   * :js:meth:`~Markup.Shapes.Rectangle.getFillOpacity`
   * :js:meth:`~Markup.Shapes.Rectangle.getPosition`
   * :js:meth:`~Markup.Shapes.Rectangle.getSize`
   * :js:meth:`~Markup.Shapes.Rectangle.getStrokeColor`
   * :js:meth:`~Markup.Shapes.Rectangle.getStrokeWidth`
   * :js:meth:`~Markup.Shapes.Rectangle.setBorderRadius`
   * :js:meth:`~Markup.Shapes.Rectangle.setFillColor`
   * :js:meth:`~Markup.Shapes.Rectangle.setFillOpacity`
   * :js:meth:`~Markup.Shapes.Rectangle.setPosition`
   * :js:meth:`~Markup.Shapes.Rectangle.setSize`
   * :js:meth:`~Markup.Shapes.Rectangle.setStrokeColor`
   * :js:meth:`~Markup.Shapes.Rectangle.setStrokeWidth`





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

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

.. container:: ts-api-section

   .. js:function:: Rectangle.constructor([ position[, size]])

      :param position: :ts-api-decorator:`optional` the screen space position of the top left of the rectangle.
      :type position: Point2
      :param size: :ts-api-decorator:`optional` the point object representing the width and height of the rectangle in pixels.
      :type size: Point2


      Creates a new rectangle markup item


      :rtype: Rectangle



Methods
=======

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

getBorderRadius
---------------

.. js:method:: Rectangle.getBorderRadius()



   Gets the border radius for this shape

   :returns: the border radius


   :rtype: number

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

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

.. js:method:: Rectangle.getFillColor()



   Gets the fill color for this shape

   :returns: the fill color


   :rtype: Color

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

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

.. js:method:: Rectangle.getFillOpacity()



   Gets the fill opacity for this shape

   :returns: the fill opacity


   :rtype: number

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

getPosition
-----------

.. js:method:: Rectangle.getPosition()



   Gets rectangle position

   :returns: the rectangle position


   :rtype: Point2

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

getSize
-------

.. js:method:: Rectangle.getSize()



   Gets rectangle size

   :returns: the rectangle size


   :rtype: Point2

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

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

.. js:method:: Rectangle.getStrokeColor()



   Gets the stroke color for this shape

   :returns: the stroke color


   :rtype: Color

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

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

.. js:method:: Rectangle.getStrokeWidth()



   Gets the stroke width for this shape in pixels

   :returns: the stroke width in pixels


   :rtype: number

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

setBorderRadius
---------------

.. js:method:: Rectangle.setBorderRadius( borderRadius)

   :param borderRadius: the border radius in pixels
   :type borderRadius: number


   Sets the border radius for this shape


   :rtype: void

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

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

.. js:method:: Rectangle.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:: Rectangle.setFillOpacity( fillOpacity)

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


   Sets the fill opacity for this shape


   :rtype: void

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

setPosition
-----------

.. js:method:: Rectangle.setPosition( position)

   :param position: the top left corner of the rectangle
   :type position: Point2


   Sets the rectanlge position


   :rtype: void

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

setSize
-------

.. js:method:: Rectangle.setSize( size)

   :param size: indicating the rectangle width and height
   :type size: Point2


   Sets the rectanlge size


   :rtype: void

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

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

.. js:method:: Rectangle.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:: Rectangle.setStrokeWidth( strokeWidth)

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


   Sets the stroke width for this shape in pixels


   :rtype: void

