diff options
author | Raul Santos <raulsntos@gmail.com> | 2022-09-15 10:57:32 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2022-09-15 12:03:02 +0200 |
commit | 361ff552413f81702475d0d6547eb787acc53660 (patch) | |
tree | f9f9e2705a425f3641a26eeaef687e07294933ff /doc/classes/CanvasItem.xml | |
parent | 20d6672846b3fd1537603ac080116dcc914c10e3 (diff) |
Fix theme methods usage in docs
- Fix usages of `get_icon` that was renamed
`get_theme_icon`.
- Replace `new Control().get_font*` with
`ThemeDB.fallback_font*`.
Diffstat (limited to 'doc/classes/CanvasItem.xml')
-rw-r--r-- | doc/classes/CanvasItem.xml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 70d825efac..d74f49c897 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -310,16 +310,16 @@ # 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") - var default_font_size = Control.new().get_font_size("font_size") - draw_string(default_font, Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size) + 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) [/gdscript] [csharp] // If using this method in a script that redraws constantly, move the - // `default_font` declaration to a member variable assigned in `_ready()` + // `default_font` declaration to a member variable assigned in `_Ready()` // so the Control is only created once. - Font defaultFont = new Control().GetFont("font"); - int defaultFontSize = new Control().GetFontSize("font_size"); + Font defaultFont = ThemeDB.FallbackFont; + int defaultFontSize = ThemeDB.FallbackFontSize; DrawString(defaultFont, new Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, defaultFontSize); [/csharp] [/codeblocks] |