class_scriptcreatedialog.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ScriptCreateDialog.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ScriptCreateDialog:
  6. ScriptCreateDialog
  7. ==================
  8. **Inherits:** :ref:`ConfirmationDialog<class_ConfirmationDialog>` **<** :ref:`AcceptDialog<class_AcceptDialog>` **<** :ref:`WindowDialog<class_WindowDialog>` **<** :ref:`Popup<class_Popup>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. The Editor's popup dialog for creating new :ref:`Script<class_Script>` files.
  13. Properties
  14. ----------
  15. +-------------------------------+-------------------+-----------------------------+
  16. | :ref:`bool<class_bool>` | dialog_hide_on_ok | **O:** false |
  17. +-------------------------------+-------------------+-----------------------------+
  18. | :ref:`float<class_float>` | margin_bottom | **O:** 76.0 |
  19. +-------------------------------+-------------------+-----------------------------+
  20. | :ref:`float<class_float>` | margin_right | **O:** 200.0 |
  21. +-------------------------------+-------------------+-----------------------------+
  22. | :ref:`Vector2<class_Vector2>` | rect_size | **O:** Vector2( 200, 76 ) |
  23. +-------------------------------+-------------------+-----------------------------+
  24. | :ref:`String<class_String>` | window_title | **O:** "Attach Node Script" |
  25. +-------------------------------+-------------------+-----------------------------+
  26. Methods
  27. -------
  28. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`config<class_ScriptCreateDialog_method_config>` **(** :ref:`String<class_String>` inherits, :ref:`String<class_String>` path, :ref:`bool<class_bool>` built_in_enabled=true **)** |
  30. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. Signals
  32. -------
  33. .. _class_ScriptCreateDialog_signal_script_created:
  34. - **script_created** **(** :ref:`Script<class_Script>` script **)**
  35. Emitted when the user clicks the OK button.
  36. Description
  37. -----------
  38. The ``ScriptCreateDialog`` creates script files according to a given template for a given scripting language. The standard use is to configure its fields prior to calling one of the :ref:`Popup.popup<class_Popup_method_popup>` methods.
  39. ::
  40. func _ready():
  41. dialog.config("Node", "res://new_node.gd") # For in-engine types
  42. dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types
  43. dialog.popup_centered()
  44. Method Descriptions
  45. -------------------
  46. .. _class_ScriptCreateDialog_method_config:
  47. - void **config** **(** :ref:`String<class_String>` inherits, :ref:`String<class_String>` path, :ref:`bool<class_bool>` built_in_enabled=true **)**
  48. Prefills required fields to configure the ScriptCreateDialog for use.