.. role:: clio-inherited
   :class: clio-flag clio-flag-inherited


#######
TextBox
#######

.. js:class:: Markup.Shapes.TextBox

   This object encapsulates a text and rectangle object into one entity. Sizing of the box and positioning of the string is handled by the system. This class consists of two portions which control the look and feel of the markup. The text portion controls the styling of the text, while the box portion controls the styling of the outer rectangle.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~Markup.Shapes.TextBox.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~Markup.Shapes.TextBox.getBoxPortion`
   * :js:meth:`~Markup.Shapes.TextBox.getPadding`
   * :js:meth:`~Markup.Shapes.TextBox.getPosition`
   * :js:meth:`~Markup.Shapes.TextBox.getTextPortion`
   * :js:meth:`~Markup.Shapes.TextBox.getTextString`
   * :js:meth:`~Markup.Shapes.TextBox.setPadding`
   * :js:meth:`~Markup.Shapes.TextBox.setPosition`
   * :js:meth:`~Markup.Shapes.TextBox.setTextString`
   
   




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

.. js:method:: Markup.Shapes.TextBox.constructor

   .. rst-class:: sig-pretty-signature
   
      | TextBox(**position**\ : :js:class:`~Point2`\ , **text**\ : *string*\ ): :js:class:`TextBox <Markup.Shapes.TextBox>`
   
   Creates a new TextBox Markup Shape.
   
   **Parameters**
   
      **position**\ : :js:class:`~Point2`
   
         the screen space point of the top left of the box. Default value is (0,0).
   
   
      **text**\ : *string*
   
         the text string for the box. Default value is empty string.
   
   
   
   **Returns**\ : :js:class:`TextBox <Markup.Shapes.TextBox>`
   





Methods
=======

.. js:method:: Markup.Shapes.TextBox.getBoxPortion

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getBoxPortion(): :js:class:`RectangleBase <Markup.Shapes.RectangleBase>`
   
   Gets the Box portion of the TextBox. Use the methods on this object to modify the appearance of the rectangle around the text string
   
   **Returns**\ : :js:class:`RectangleBase <Markup.Shapes.RectangleBase>`
   
      the rectangle markup object.
   
   



.. js:method:: Markup.Shapes.TextBox.getPadding

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getPadding(): *number*
   
   Gets the Pixel distance between the text and outer rectangle
   
   **Returns**\ : *number*
   
      the padding value.
   
   



.. js:method:: Markup.Shapes.TextBox.getPosition

   .. rst-class:: sig-pretty-signature
   
      | getPosition(): :js:class:`~Point2`
   
   Gets the position in screen space of the top-left corner of the TextBox rectangle
   
   **Returns**\ : :js:class:`~Point2`
   
      the TextBox position
   
   



.. js:method:: Markup.Shapes.TextBox.getTextPortion

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getTextPortion(): :js:class:`TextMarkupBase <Markup.Shapes.TextMarkupBase>`
   
   Gets the Text portion of the TextBox. Use the methods on this object to modify the appearance of the text string
   
   **Returns**\ : :js:class:`TextMarkupBase <Markup.Shapes.TextMarkupBase>`
   
      the text markup object
   
   



.. js:method:: Markup.Shapes.TextBox.getTextString

   .. rst-class:: sig-pretty-signature
   
      | getTextString(): *string*
   
   Gets the text string for this box
   
   **Returns**\ : *string*
   
      the text string
   
   



.. js:method:: Markup.Shapes.TextBox.setPadding

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setPadding(**padding**\ : *number*\ ): *void*
   
   Sets the Pixel distance between the text and outer rectangle
   
   **Parameters**
   
      **padding**\ : *number*
   
         the padding value.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.TextBox.setPosition

   .. rst-class:: sig-pretty-signature
   
      | setPosition(**position**\ : :js:class:`~Point2`\ ): *void*
   
   Sets the position in screen space of the top-left corner of the TextBox rectangle
   
   **Parameters**
   
      **position**\ : :js:class:`~Point2`
   
         the TextBox position
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.TextBox.setTextString

   .. rst-class:: sig-pretty-signature
   
      | setTextString(**text**\ : *string*\ ): *void*
   
   Sets the text string for this box
   
   **Parameters**
   
      **text**\ : *string*
   
         the text string
   
   
   
   **Returns**\ : *void*
   





