From 949cf045f00c62e189e5c01c61e42193da02ec92 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 1 Apr 2025 00:24:19 +0200 Subject: [PATCH] Document `@export_tool_button` icon parameter in GDScript exports --- .../scripting/gdscript/gdscript_exports.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tutorials/scripting/gdscript/gdscript_exports.rst b/tutorials/scripting/gdscript/gdscript_exports.rst index 7a378f2ab66..c3470f29ec3 100644 --- a/tutorials/scripting/gdscript/gdscript_exports.rst +++ b/tutorials/scripting/gdscript/gdscript_exports.rst @@ -494,7 +494,21 @@ for a list of parameters and their allowed values. If you need to create a clickable inspector button, you can use ``@export_tool_button``. This exports a ``Callable`` property as a clickable button. When the button is pressed, the callable is called. -Export a button with label ``"Hello"`` and icon ``"Callable"``. When you press it, it will print ``"Hello world!"``. +You can specify a custom icon name, which must match one of the icon +file names from the +`editor/icons `__ +folder of the Godot source repository (case-sensitive). +You can also browse the editor icons using the +`Godot editor icons `__ website. + +For example, if you wish to use ``Node2D.svg`` from that folder, you must +specify ``"Node2D"`` as the second parameter of ``@export_tool_button``. It is +not currently possible to use custom icons from the project folder; only +built-in editor icons can be used. + +This exports a button with label ``"Hello"`` and icon ``"Callable"`` (which is the +default if no icon is specified). When you press it, it will print ``"Hello +world!"``. ::