File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tutorials/scripting/gdscript Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,24 @@ for a list of parameters and their allowed values.
480
480
When using ``@export_custom ``, GDScript does not perform any validation on
481
481
the syntax. Invalid syntax may have unexpected behavior in the inspector.
482
482
483
+ ``@export_tool_button ``
484
+ -----------------------
485
+
486
+ If you need to create a clickable inspector button, you can use ``@export_tool_button ``.
487
+ This exports a ``Callable `` property as a clickable button. When the button is pressed, the callable is called.
488
+
489
+ Export a button with label ``"Hello" `` and icon ``"Callable" ``. When you press it, it will print ``"Hello world!" ``.
490
+
491
+ ::
492
+
493
+ @tool
494
+ extends Node
495
+
496
+ @export_tool_button("Hello", "Callable") var hello_action = hello
497
+
498
+ func hello():
499
+ print("Hello world!")
500
+
483
501
Setting exported variables from a tool script
484
502
---------------------------------------------
485
503
You can’t perform that action at this time.
0 commit comments