summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2020-03-02 20:53:41 -0500
committerAaron Franke <arnfranke@yahoo.com>2020-03-04 15:49:20 -0500
commit68d73ecf60b35c06ee645fe0fed2b4dc426e0f81 (patch)
tree654cbd4e7cbde804a78043509850011305f52abb /doc
parente89754fa1f5ff3b11dddae399ac2838fd0f1acfe (diff)
Document EditorPlugin get_plugin_icon and get_plugin_name
The return value's type hint is now accurate.
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/EditorPlugin.xml14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index d17fd0a661..587fd51f1e 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -267,15 +267,27 @@
</description>
</method>
<method name="get_plugin_icon" qualifiers="virtual">
- <return type="Object">
+ <return type="Texture2D">
</return>
<description>
+ Override this method in your plugin to return a [Texture2D] in order to give it an icon.
+ For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
+ Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size.
+ [codeblock]
+ func get_plugin_icon():
+ # 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")
+ [/codeblock]
</description>
</method>
<method name="get_plugin_name" qualifiers="virtual">
<return type="String">
</return>
<description>
+ Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor.
+ For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
</description>
</method>
<method name="get_script_create_dialog">