Skip to content

Document @export_tool_button icon parameter in GDScript exports #10823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tutorials/scripting/gdscript/gdscript_exports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/godotengine/godot/tree/master/editor/icons>`__
folder of the Godot source repository (case-sensitive).
You can also browse the editor icons using the
`Godot editor icons <https://godot-editor-icons.github.io/>`__ 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!"``.

::

Expand Down
Loading