Translate GDScript Code Examples to C# (C)
Translates Code Examples in classes beginning with `C`. Includes: * Callable * CanvasItem * CharFXTransform * Color * ColorRect * ConfigFile * ConfirmationDialog * Control * Crypto
This commit is contained in:
parent
fea72f2a71
commit
ae873ab822
9 changed files with 495 additions and 112 deletions
|
|
@ -318,13 +318,22 @@
|
|||
<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.
|
||||
[b]Example using the default project font:[/b]
|
||||
[codeblock]
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
# 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]
|
||||
[/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");
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
See also [method Font.draw].
|
||||
</description>
|
||||
</method>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue