diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index f435d9f753..53205d9312 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -376,20 +376,10 @@ [b]Example:[/b] Draw "Hello world", using the project's default font: [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 = ThemeDB.fallback_font - var default_font_size = ThemeDB.fallback_font_size - draw_string(default_font, Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, default_font_size) + draw_string(ThemeDB.fallback_font, Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, ThemeDB.fallback_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 = ThemeDB.FallbackFont; - int defaultFontSize = ThemeDB.FallbackFontSize; - DrawString(defaultFont, new Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, defaultFontSize); + DrawString(ThemeDB.FallbackFont, new Vector2(64, 64), "Hello world", HorizontalAlignment.Left, -1, ThemeDB.FallbackFontSize); [/csharp] [/codeblocks] See also [method Font.draw_string].