| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="TextLine" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Holds a line of text. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | Abstraction over [TextServer] for handling a single line of text. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | </tutorials> |
| 11 | <methods> |
| 12 | <method name="add_object"> |
| 13 | <return type="bool" /> |
| 14 | <param index="0" name="key" type="Variant" /> |
| 15 | <param index="1" name="size" type="Vector2" /> |
| 16 | <param index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" /> |
| 17 | <param index="3" name="length" type="int" default="1" /> |
| 18 | <param index="4" name="baseline" type="float" default="0.0" /> |
| 19 | <description> |
| 20 | Adds inline object to the text buffer, [param key] must be unique. In the text, object is represented as [param length] object replacement characters. |
| 21 | </description> |
| 22 | </method> |
| 23 | <method name="add_string"> |
| 24 | <return type="bool" /> |
| 25 | <param index="0" name="text" type="String" /> |
| 26 | <param index="1" name="font" type="Font" /> |
| 27 | <param index="2" name="font_size" type="int" /> |
| 28 | <param index="3" name="language" type="String" default="""" /> |
| 29 | <param index="4" name="meta" type="Variant" default="null" /> |
| 30 | <description> |
| 31 | Adds text span and font to draw it. |
| 32 | </description> |
| 33 | </method> |
| 34 | <method name="clear"> |
| 35 | <return type="void" /> |
| 36 | <description> |
| 37 | Clears text line (removes text and inline objects). |
| 38 | </description> |
| 39 | </method> |
| 40 | <method name="draw" qualifiers="const"> |
| 41 | <return type="void" /> |
| 42 | <param index="0" name="canvas" type="RID" /> |
| 43 | <param index="1" name="pos" type="Vector2" /> |
| 44 | <param index="2" name="color" type="Color" default="Color(1, 1, 1, 1)" /> |
| 45 | <param index="3" name="oversampling" type="float" default="0.0" /> |
| 46 | <description> |
| 47 | Draw text into a canvas item at a given position, with [param color]. [param pos] specifies the top left corner of the bounding box. If [param oversampling] is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used. |
| 48 | </description> |
| 49 | </method> |
| 50 | <method name="draw_outline" qualifiers="const"> |
| 51 | <return type="void" /> |
| 52 | <param index="0" name="canvas" type="RID" /> |
| 53 | <param index="1" name="pos" type="Vector2" /> |
| 54 | <param index="2" name="outline_size" type="int" default="1" /> |
| 55 | <param index="3" name="color" type="Color" default="Color(1, 1, 1, 1)" /> |
| 56 | <param index="4" name="oversampling" type="float" default="0.0" /> |
| 57 | <description> |
| 58 | Draw text into a canvas item at a given position, with [param color]. [param pos] specifies the top left corner of the bounding box. If [param oversampling] is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used. |
| 59 | </description> |
| 60 | </method> |
| 61 | <method name="duplicate" qualifiers="const"> |
| 62 | <return type="TextLine" /> |
| 63 | <description> |
| 64 | Duplicates this [TextLine]. |
| 65 | </description> |
| 66 | </method> |
| 67 | <method name="get_inferred_direction" qualifiers="const"> |
| 68 | <return type="int" enum="TextServer.Direction" /> |
| 69 | <description> |
| 70 | Returns the text writing direction inferred by the BiDi algorithm. |
| 71 | </description> |
| 72 | </method> |
| 73 | <method name="get_line_ascent" qualifiers="const"> |
| 74 | <return type="float" /> |
| 75 | <description> |
| 76 | Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical). |
| 77 | </description> |
| 78 | </method> |
| 79 | <method name="get_line_descent" qualifiers="const"> |
| 80 | <return type="float" /> |
| 81 | <description> |
| 82 | Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical). |
| 83 | </description> |
| 84 | </method> |
| 85 | <method name="get_line_underline_position" qualifiers="const"> |
| 86 | <return type="float" /> |
| 87 | <description> |
| 88 | Returns pixel offset of the underline below the baseline. |
| 89 | </description> |
| 90 | </method> |
| 91 | <method name="get_line_underline_thickness" qualifiers="const"> |
| 92 | <return type="float" /> |
| 93 | <description> |
| 94 | Returns thickness of the underline. |
| 95 | </description> |
| 96 | </method> |
| 97 | <method name="get_line_width" qualifiers="const"> |
| 98 | <return type="float" /> |
| 99 | <description> |
| 100 | Returns width (for horizontal layout) or height (for vertical) of the text. |
| 101 | </description> |
| 102 | </method> |
| 103 | <method name="get_object_rect" qualifiers="const"> |
| 104 | <return type="Rect2" /> |
| 105 | <param index="0" name="key" type="Variant" /> |
| 106 | <description> |
| 107 | Returns bounding rectangle of the inline object. |
| 108 | </description> |
| 109 | </method> |
| 110 | <method name="get_objects" qualifiers="const"> |
| 111 | <return type="Array" /> |
| 112 | <description> |
| 113 | Returns array of inline objects. |
| 114 | </description> |
| 115 | </method> |
| 116 | <method name="get_rid" qualifiers="const"> |
| 117 | <return type="RID" /> |
| 118 | <description> |
| 119 | Returns TextServer buffer RID. |
| 120 | </description> |
| 121 | </method> |
| 122 | <method name="get_size" qualifiers="const"> |
| 123 | <return type="Vector2" /> |
| 124 | <description> |
| 125 | Returns size of the bounding box of the text. |
| 126 | </description> |
| 127 | </method> |
| 128 | <method name="has_object" qualifiers="const"> |
| 129 | <return type="bool" /> |
| 130 | <param index="0" name="key" type="Variant" /> |
| 131 | <description> |
| 132 | Returns [code]true[/code] if an object with [param key] is embedded in this line. |
| 133 | </description> |
| 134 | </method> |
| 135 | <method name="hit_test" qualifiers="const"> |
| 136 | <return type="int" /> |
| 137 | <param index="0" name="coords" type="float" /> |
| 138 | <description> |
| 139 | Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position. |
| 140 | </description> |
| 141 | </method> |
| 142 | <method name="resize_object"> |
| 143 | <return type="bool" /> |
| 144 | <param index="0" name="key" type="Variant" /> |
| 145 | <param index="1" name="size" type="Vector2" /> |
| 146 | <param index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" /> |
| 147 | <param index="3" name="baseline" type="float" default="0.0" /> |
| 148 | <description> |
| 149 | Sets new size and alignment of embedded object. |
| 150 | </description> |
| 151 | </method> |
| 152 | <method name="set_bidi_override"> |
| 153 | <return type="void" /> |
| 154 | <param index="0" name="override" type="Array" /> |
| 155 | <description> |
| 156 | Overrides BiDi for the structured text. |
| 157 | Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately. |
| 158 | </description> |
| 159 | </method> |
| 160 | <method name="tab_align"> |
| 161 | <return type="void" /> |
| 162 | <param index="0" name="tab_stops" type="PackedFloat32Array" /> |
| 163 | <description> |
| 164 | Aligns text to the given tab-stops. |
| 165 | </description> |
| 166 | </method> |
| 167 | </methods> |
| 168 | <members> |
| 169 | <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> |
| 170 | Sets text alignment within the line as if the line was horizontal. |
| 171 | </member> |
| 172 | <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0"> |
| 173 | Text writing direction. |
| 174 | </member> |
| 175 | <member name="ellipsis_char" type="String" setter="set_ellipsis_char" getter="get_ellipsis_char" default=""…""> |
| 176 | Ellipsis character used for text clipping. |
| 177 | </member> |
| 178 | <member name="flags" type="int" setter="set_flags" getter="get_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="3"> |
| 179 | Line alignment rules. For more info see [TextServer]. |
| 180 | </member> |
| 181 | <member name="orientation" type="int" setter="set_orientation" getter="get_orientation" enum="TextServer.Orientation" default="0"> |
| 182 | Text orientation. |
| 183 | </member> |
| 184 | <member name="preserve_control" type="bool" setter="set_preserve_control" getter="get_preserve_control" default="false"> |
| 185 | If set to [code]true[/code] text will display control characters. |
| 186 | </member> |
| 187 | <member name="preserve_invalid" type="bool" setter="set_preserve_invalid" getter="get_preserve_invalid" default="true"> |
| 188 | If set to [code]true[/code] text will display invalid characters. |
| 189 | </member> |
| 190 | <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="3"> |
| 191 | The clipping behavior when the text exceeds the text line's set width. |
| 192 | </member> |
| 193 | <member name="width" type="float" setter="set_width" getter="get_width" default="-1.0"> |
| 194 | Text line width. |
| 195 | </member> |
| 196 | </members> |
| 197 | </class> |