2020-08-12 13:49:10 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-06-04 18:03:15 +02:00
<class name= "TextParagraph" inherits= "RefCounted" version= "4.0" >
2020-08-12 13:49:10 +02:00
<brief_description >
Holds a paragraph of text.
</brief_description>
<description >
Abstraction over [TextServer] for handling paragraph of text.
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_object" >
<return type= "bool" >
</return>
<argument index= "0" name= "key" type= "Variant" >
</argument>
<argument index= "1" name= "size" type= "Vector2" >
</argument>
<argument index= "2" name= "inline_align" type= "int" enum= "VAlign" default= "1" >
</argument>
<argument index= "3" name= "length" type= "int" default= "1" >
</argument>
<description >
Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
</description>
</method>
<method name= "add_string" >
<return type= "bool" >
</return>
<argument index= "0" name= "text" type= "String" >
</argument>
<argument index= "1" name= "fonts" type= "Font" >
</argument>
<argument index= "2" name= "size" type= "int" >
</argument>
<argument index= "3" name= "opentype_features" type= "Dictionary" default= "{
}">
</argument>
<argument index= "4" name= "language" type= "String" default= """" >
</argument>
<description >
Adds text span and font to draw it.
</description>
</method>
<method name= "clear" >
<return type= "void" >
</return>
<description >
Clears text paragraph (removes text and inline objects).
</description>
</method>
2020-11-19 15:45:23 +01:00
<method name= "clear_dropcap" >
<return type= "void" >
</return>
<description >
Removes dropcap.
</description>
</method>
2020-08-12 13:49:10 +02:00
<method name= "draw" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "canvas" type= "RID" >
</argument>
<argument index= "1" name= "pos" type= "Vector2" >
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "2" name= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-08-12 13:49:10 +02:00
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "3" name= "dc_color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-11-19 15:45:23 +01:00
</argument>
2020-08-12 13:49:10 +02:00
<description >
2020-11-19 15:45:23 +01:00
Draw all lines of the text and drop cap into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
</description>
</method>
<method name= "draw_dropcap" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "canvas" type= "RID" >
</argument>
<argument index= "1" name= "pos" type= "Vector2" >
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "2" name= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-11-19 15:45:23 +01:00
</argument>
<description >
Draw drop cap into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
</description>
</method>
<method name= "draw_dropcap_outline" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "canvas" type= "RID" >
</argument>
<argument index= "1" name= "pos" type= "Vector2" >
</argument>
<argument index= "2" name= "outline_size" type= "int" default= "1" >
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "3" name= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-11-19 15:45:23 +01:00
</argument>
<description >
Draw drop cap outline into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
2020-08-12 13:49:10 +02:00
</description>
</method>
<method name= "draw_line" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "canvas" type= "RID" >
</argument>
<argument index= "1" name= "pos" type= "Vector2" >
</argument>
<argument index= "2" name= "line" type= "int" >
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "3" name= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-08-12 13:49:10 +02:00
</argument>
<description >
Draw single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
</description>
</method>
<method name= "draw_line_outline" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "canvas" type= "RID" >
</argument>
<argument index= "1" name= "pos" type= "Vector2" >
</argument>
<argument index= "2" name= "line" type= "int" >
</argument>
<argument index= "3" name= "outline_size" type= "int" default= "1" >
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "4" name= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-08-12 13:49:10 +02:00
</argument>
<description >
Draw outline of the single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
</description>
</method>
<method name= "draw_outline" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "canvas" type= "RID" >
</argument>
2020-11-19 15:45:23 +01:00
<argument index= "1" name= "pos" type= "Vector2" >
</argument>
<argument index= "2" name= "outline_size" type= "int" default= "1" >
2020-08-12 13:49:10 +02:00
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "3" name= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-08-12 13:49:10 +02:00
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "4" name= "dc_color" type= "Color" default= "Color(1, 1, 1, 1)" >
2020-08-12 13:49:10 +02:00
</argument>
<description >
2021-03-18 12:04:28 +01:00
Draw outlines of all lines of the text and drop cap into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
2020-11-19 15:45:23 +01:00
</description>
</method>
<method name= "get_dropcap_lines" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns number of lines used by dropcap.
</description>
</method>
<method name= "get_dropcap_rid" qualifiers= "const" >
<return type= "RID" >
</return>
<description >
Return drop cap text buffer RID.
</description>
</method>
<method name= "get_dropcap_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
Returns drop cap bounding box size.
2020-08-12 13:49:10 +02:00
</description>
</method>
<method name= "get_line_ascent" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
</description>
</method>
<method name= "get_line_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns number of lines in the paragraph.
</description>
</method>
<method name= "get_line_descent" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns the text line descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
</description>
</method>
<method name= "get_line_object_rect" qualifiers= "const" >
<return type= "Rect2" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<argument index= "1" name= "key" type= "Variant" >
</argument>
<description >
Returns bounding rectangle of the inline object.
</description>
</method>
<method name= "get_line_objects" qualifiers= "const" >
<return type= "Array" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns array of inline objects in the line.
</description>
</method>
<method name= "get_line_range" qualifiers= "const" >
<return type= "Vector2i" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns character range of the line.
</description>
</method>
<method name= "get_line_rid" qualifiers= "const" >
<return type= "RID" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns TextServer line buffer RID.
</description>
</method>
<method name= "get_line_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns size of the bounding box of the line of text.
</description>
</method>
<method name= "get_line_underline_position" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns pixel offset of the underline below the baseline.
</description>
</method>
<method name= "get_line_underline_thickness" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns thickness of the underline.
</description>
</method>
<method name= "get_line_width" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "line" type= "int" >
</argument>
<description >
Returns width (for horizontal layout) or height (for vertical) of the line of text.
</description>
</method>
<method name= "get_non_wraped_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
Returns the size of the bounding box of the paragraph, without line breaks.
</description>
</method>
<method name= "get_rid" qualifiers= "const" >
<return type= "RID" >
</return>
<description >
Returns TextServer full string buffer RID.
</description>
</method>
<method name= "get_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
Returns the size of the bounding box of the paragraph.
</description>
</method>
2021-03-29 16:26:53 +02:00
<method name= "get_spacing_bottom" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns extra spacing at the bottom of the line. See [member Font.extra_spacing_bottom].
</description>
</method>
<method name= "get_spacing_top" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns extra spacing at the top of the line. See [member Font.extra_spacing_top].
</description>
</method>
2020-08-12 13:49:10 +02:00
<method name= "hit_test" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "coords" type= "Vector2" >
</argument>
<description >
Returns caret character offset at the specified coordinates. This function always returns a valid position.
</description>
</method>
<method name= "resize_object" >
<return type= "bool" >
</return>
<argument index= "0" name= "key" type= "Variant" >
</argument>
<argument index= "1" name= "size" type= "Vector2" >
</argument>
<argument index= "2" name= "inline_align" type= "int" enum= "VAlign" default= "1" >
</argument>
<description >
Sets new size and alignment of embedded object.
</description>
</method>
<method name= "set_bidi_override" >
<return type= "void" >
</return>
<argument index= "0" name= "override" type= "Array" >
</argument>
<description >
Overrides BiDi for the structured text.
Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
</description>
</method>
2020-11-19 15:45:23 +01:00
<method name= "set_dropcap" >
<return type= "bool" >
</return>
<argument index= "0" name= "text" type= "String" >
</argument>
<argument index= "1" name= "fonts" type= "Font" >
</argument>
<argument index= "2" name= "size" type= "int" >
</argument>
2019-09-24 19:45:03 +02:00
<argument index= "3" name= "dropcap_margins" type= "Rect2" default= "Rect2(0, 0, 0, 0)" >
2020-11-19 15:45:23 +01:00
</argument>
<argument index= "4" name= "opentype_features" type= "Dictionary" default= "{
}">
</argument>
<argument index= "5" name= "language" type= "String" default= """" >
</argument>
<description >
Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text.
</description>
</method>
2020-08-12 13:49:10 +02:00
<method name= "tab_align" >
<return type= "void" >
</return>
<argument index= "0" name= "tab_stops" type= "PackedFloat32Array" >
</argument>
<description >
Aligns paragraph to the given tab-stops.
</description>
</method>
</methods>
<members >
<member name= "align" type= "int" setter= "set_align" getter= "get_align" enum= "HAlign" default= "0" >
Paragraph horizontal alignment.
</member>
<member name= "direction" type= "int" setter= "set_direction" getter= "get_direction" enum= "TextServer.Direction" default= "0" >
Text writing direction.
</member>
<member name= "flags" type= "int" setter= "set_flags" getter= "get_flags" default= "51" >
Line breaking and alignment rules. For more info see [TextServer].
</member>
<member name= "orientation" type= "int" setter= "set_orientation" getter= "get_orientation" enum= "TextServer.Orientation" default= "0" >
Text orientation.
</member>
<member name= "preserve_control" type= "bool" setter= "set_preserve_control" getter= "get_preserve_control" default= "false" >
If set to [code]true[/code] text will display control characters.
</member>
<member name= "preserve_invalid" type= "bool" setter= "set_preserve_invalid" getter= "get_preserve_invalid" default= "true" >
If set to [code]true[/code] text will display invalid characters.
</member>
<member name= "width" type= "float" setter= "set_width" getter= "get_width" default= "-1.0" >
Paragraph width.
</member>
</members>
<constants >
</constants>
</class>