:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLShapedParagraph.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLShapedParagraph:

TLShapedParagraph
=================

**Inherits:** 

**Category:** Core

Brief Description
-----------------

Class for formatting entire paragraphs of text at once.

Properties
----------

+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| Color                                                           | :ref:`back_color<class_TLShapedParagraph_property_back_color>`     | Color( 1, 1, 1, 0 ) |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| int                                                             | :ref:`brk_flags<class_TLShapedParagraph_property_brk_flags>`       | 2                   |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| int                                                             | :ref:`halign<class_TLShapedParagraph_property_halign>`             | 0                   |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| float                                                           | :ref:`indent<class_TLShapedParagraph_property_indent>`             | 0.0                 |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| int                                                             | :ref:`jst_flags<class_TLShapedParagraph_property_jst_flags>`       | 1                   |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| float                                                           | :ref:`line_spacing<class_TLShapedParagraph_property_line_spacing>` | 1.0                 |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| :ref:`TLShapedAttributedString<class_TLShapedAttributedString>` | :ref:`string<class_TLShapedParagraph_property_string>`             |                     |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| float                                                           | :ref:`width<class_TLShapedParagraph_property_width>`               | -1.0                |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+

Methods
-------

.. table::
   :class: longtable
   :widths: 7 20

   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                            | :ref:`copy_properties<class_TLShapedParagraph_method_copy_properties>` **(** :ref:`TLShapedParagraph<class_TLShapedParagraph>` source **)** |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | :ref:`TLShapedAttributedString<class_TLShapedAttributedString>` | :ref:`get_line<class_TLShapedParagraph_method_get_line>` **(** int index **)** const                                                        |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                           | :ref:`get_line_bounds<class_TLShapedParagraph_method_get_line_bounds>` **(** **)** const                                                    |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                             | :ref:`get_lines<class_TLShapedParagraph_method_get_lines>` **(** **)** const                                                                |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | Vector2                                                         | :ref:`get_size<class_TLShapedParagraph_method_get_size>` **(** **)** const                                                                  |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                           | :ref:`get_word_bounds<class_TLShapedParagraph_method_get_word_bounds>` **(** **)** const                                                    |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+

Signals
-------

.. _class_TLShapedParagraph_signal_paragraph_changed:

- **paragraph_changed** **(** **)**

Emitted when text or attributes of the paragraph are changed.

Enumerations
------------

.. _enum_TLShapedParagraph_ParaHAlign:

.. _class_TLShapedParagraph_constant_PARA_HALIGN_LEFT:

.. _class_TLShapedParagraph_constant_PARA_HALIGN_CENTER:

.. _class_TLShapedParagraph_constant_PARA_HALIGN_RIGHT:

.. _class_TLShapedParagraph_constant_PARA_HALIGN_FILL:

enum **ParaHAlign**:

- **PARA_HALIGN_LEFT** = **0** --- Align rows to the left (default).

- **PARA_HALIGN_CENTER** = **1** --- Align rows centered.

- **PARA_HALIGN_RIGHT** = **2** --- Align rows to the right.

- **PARA_HALIGN_FILL** = **3** --- Expand row white spaces to fit the width.

Property Descriptions
---------------------

.. _class_TLShapedParagraph_property_back_color:

- Color **back_color**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-----------------------+
   | *Default* | Color( 1, 1, 1, 0 )   |
   +-----------+-----------------------+
   | *Setter*  | set_back_color(value) |
   +-----------+-----------------------+
   | *Getter*  | get_back_color()      |
   +-----------+-----------------------+

Background color of the paragraph.

----

.. _class_TLShapedParagraph_property_brk_flags:

- int **brk_flags**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+----------------------+
   | *Default* | 2                    |
   +-----------+----------------------+
   | *Setter*  | set_brk_flags(value) |
   +-----------+----------------------+
   | *Getter*  | get_brk_flags()      |
   +-----------+----------------------+

Line breaking flags.

----

.. _class_TLShapedParagraph_property_halign:

- int **halign**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------+
   | *Default* | 0                 |
   +-----------+-------------------+
   | *Setter*  | set_halign(value) |
   +-----------+-------------------+
   | *Getter*  | get_halign()      |
   +-----------+-------------------+

Horizontal alignment.

----

.. _class_TLShapedParagraph_property_indent:

- float **indent**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------+
   | *Default* | 0.0               |
   +-----------+-------------------+
   | *Setter*  | set_indent(value) |
   +-----------+-------------------+
   | *Getter*  | get_indent()      |
   +-----------+-------------------+

Indentation.

----

.. _class_TLShapedParagraph_property_jst_flags:

- int **jst_flags**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+----------------------+
   | *Default* | 1                    |
   +-----------+----------------------+
   | *Setter*  | set_jst_flags(value) |
   +-----------+----------------------+
   | *Getter*  | get_jst_flags()      |
   +-----------+----------------------+

Justification flags.

----

.. _class_TLShapedParagraph_property_line_spacing:

- float **line_spacing**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------------+
   | *Default* | 1.0                     |
   +-----------+-------------------------+
   | *Setter*  | set_line_spacing(value) |
   +-----------+-------------------------+
   | *Getter*  | get_line_spacing()      |
   +-----------+-------------------------+

Lien spacing in pixels.

----

.. _class_TLShapedParagraph_property_string:

- :ref:`TLShapedAttributedString<class_TLShapedAttributedString>` **string**

.. table::
   :class: longtable
   :widths: 7 20

   +----------+-------------------+
   | *Setter* | set_string(value) |
   +----------+-------------------+
   | *Getter* | get_string()      |
   +----------+-------------------+

Text and text attributes of the paragraph.

----

.. _class_TLShapedParagraph_property_width:

- float **width**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+------------------+
   | *Default* | -1.0             |
   +-----------+------------------+
   | *Setter*  | set_width(value) |
   +-----------+------------------+
   | *Getter*  | get_width()      |
   +-----------+------------------+

Max width of the paragraph.

Method Descriptions
-------------------

.. _class_TLShapedParagraph_method_copy_properties:

- void **copy_properties** **(** :ref:`TLShapedParagraph<class_TLShapedParagraph>` source **)**

Copies properties of the another paragraph.

----

.. _class_TLShapedParagraph_method_get_line:

- :ref:`TLShapedAttributedString<class_TLShapedAttributedString>` **get_line** **(** int index **)** const

Returns line of the pargraphs. NOTE: read only, changes to the line will be discarded on paragraph update!

----

.. _class_TLShapedParagraph_method_get_line_bounds:

- Array **get_line_bounds** **(** **)** const

Returns array of the line boundaries as ``Vector2(start, end)``.

----

.. _class_TLShapedParagraph_method_get_lines:

- int **get_lines** **(** **)** const

Returns number of lines in the paragraph.

----

.. _class_TLShapedParagraph_method_get_size:

- Vector2 **get_size** **(** **)** const

Returns size of the paragraph in pixels.

----

.. _class_TLShapedParagraph_method_get_word_bounds:

- Array **get_word_bounds** **(** **)** const

Returns array of the word boundaries as ``Vector2(start, end)``.

