summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-15 20:11:50 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-15 20:11:50 +0200
commit3ac332a411dded89cdf47abf367ca017a88b2eb6 (patch)
tree23566928633e4394e1f9b37f41ba208c78845cf8 /doc/classes
parent7a90345b01c7e06d5a1b3c9d70c6469562694a59 (diff)
parent361ff552413f81702475d0d6547eb787acc53660 (diff)
Merge pull request #65819 from raulsntos/theme-docs
Fix theme methods usage in docs
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/CanvasItem.xml12
-rw-r--r--doc/classes/EditorPlugin.xml4
2 files changed, 8 insertions, 8 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]
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 8f4c848041..27cf410c15 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -237,7 +237,7 @@
# You can use a custom icon:
return preload("res://addons/my_plugin/my_plugin_icon.svg")
# Or use a built-in icon:
- return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons")
+ return get_editor_interface().get_base_control().get_theme_icon("Node", "EditorIcons")
[/gdscript]
[csharp]
public override Texture2D GetPluginIcon()
@@ -245,7 +245,7 @@
// You can use a custom icon:
return ResourceLoader.Load&lt;Texture2D&gt;("res://addons/my_plugin/my_plugin_icon.svg");
// Or use a built-in icon:
- return GetEditorInterface().GetBaseControl().GetIcon("Node", "EditorIcons");
+ return GetEditorInterface().GetBaseControl().GetThemeIcon("Node", "EditorIcons");
}
[/csharp]
[/codeblocks]