|
@@ -296,7 +296,16 @@
|
|
|
<argument index="4" name="clip_w" type="int" default="-1">
|
|
|
</argument>
|
|
|
<description>
|
|
|
- Draws a string using a custom font.
|
|
|
+ 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.
|
|
|
+ [b]Example using the default project font:[/b]
|
|
|
+ [codeblock]
|
|
|
+ # 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.
|
|
|
+ var default_font = Control.new().get_font("font")
|
|
|
+ draw_string(default_font, Vector2(64, 64), "Hello world")
|
|
|
+ [/codeblock]
|
|
|
+ See also [method Font.draw].
|
|
|
</description>
|
|
|
</method>
|
|
|
<method name="draw_style_box">
|