diff options
Diffstat (limited to 'doc/classes/CanvasItem.xml')
-rw-r--r-- | doc/classes/CanvasItem.xml | 75 |
1 files changed, 64 insertions, 11 deletions
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 8efa1adae8..bd648c6de0 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -41,22 +41,30 @@ </argument> <argument index="6" name="width" type="float" default="1.0"> </argument> + <argument index="7" name="antialiased" type="bool" default="false"> + </argument> <description> Draws an arc between the given angles. The larger the value of [code]point_count[/code], the smoother the curve. </description> </method> - <method name="draw_char"> + <method name="draw_char" qualifiers="const"> <return type="float"> </return> <argument index="0" name="font" type="Font"> </argument> - <argument index="1" name="position" type="Vector2"> + <argument index="1" name="pos" type="Vector2"> </argument> <argument index="2" name="char" type="String"> </argument> - <argument index="3" name="next" type="String"> + <argument index="3" name="next" type="String" default=""""> + </argument> + <argument index="4" name="size" type="int" default="-1"> + </argument> + <argument index="5" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> - <argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="6" name="outline_size" type="int" default="0"> + </argument> + <argument index="7" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> </argument> <description> Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character. @@ -146,6 +154,35 @@ Draws multiple, parallel lines with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. </description> </method> + <method name="draw_multiline_string" qualifiers="const"> + <return type="void"> + </return> + <argument index="0" name="font" type="Font"> + </argument> + <argument index="1" name="pos" type="Vector2"> + </argument> + <argument index="2" name="text" type="String"> + </argument> + <argument index="3" name="align" type="int" enum="HAlign" default="0"> + </argument> + <argument index="4" name="width" type="float" default="-1"> + </argument> + <argument index="5" name="max_lines" type="int" default="-1"> + </argument> + <argument index="6" name="size" type="int" default="-1"> + </argument> + <argument index="7" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + </argument> + <argument index="8" name="outline_size" type="int" default="0"> + </argument> + <argument index="9" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> + </argument> + <argument index="10" name="flags" type="int" default="51"> + </argument> + <description> + Breaks [code]text[/code] to the lines and draws it using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + </description> + </method> <method name="draw_multimesh"> <return type="void"> </return> @@ -181,6 +218,8 @@ </argument> <argument index="2" name="width" type="float" default="1.0"> </argument> + <argument index="3" name="antialiased" type="bool" default="false"> + </argument> <description> Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code]. </description> @@ -194,6 +233,8 @@ </argument> <argument index="2" name="width" type="float" default="1.0"> </argument> + <argument index="3" name="antialiased" type="bool" default="false"> + </argument> <description> Draws interconnected line segments with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. </description> @@ -253,18 +294,28 @@ Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this. </description> </method> - <method name="draw_string"> + <method name="draw_string" qualifiers="const"> <return type="void"> </return> <argument index="0" name="font" type="Font"> </argument> - <argument index="1" name="position" type="Vector2"> + <argument index="1" name="pos" type="Vector2"> </argument> <argument index="2" name="text" type="String"> </argument> - <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + <argument index="3" name="align" type="int" enum="HAlign" default="0"> + </argument> + <argument index="4" name="width" type="float" default="-1"> + </argument> + <argument index="5" name="size" type="int" default="-1"> + </argument> + <argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + </argument> + <argument index="7" name="outline_size" type="int" default="0"> + </argument> + <argument index="8" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )"> </argument> - <argument index="4" name="clip_w" type="int" default="-1"> + <argument index="9" name="flags" type="int" default="3"> </argument> <description> Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. @@ -275,17 +326,19 @@ # `default_font` declaration to a member variable assigned in `_ready()` # so the Control is only created once. var default_font = Control.new().get_font("font") - draw_string(default_font, Vector2(64, 64), "Hello world") + var default_font_size = Control.new().get_font_size("font_size") + draw_string(default_font, Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, font_size) [/gdscript] [csharp] // If using this method in a script that redraws constantly, move the // `default_font` declaration to a member variable assigned in `_ready()` // so the Control is only created once. Font defaultFont = new Control().GetFont("font"); - DrawString(defaultFont, new Vector2(64, 64), "Hello world"); + int defaultFontSize = new Control().GetFontSize("font_size"); + DrawString(defaultFont, new Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, defaultFontSize); [/csharp] [/codeblocks] - See also [method Font.draw]. + See also [method Font.draw_string]. </description> </method> <method name="draw_style_box"> |