class_scriptcreatedialog.rst 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. The Editor's popup dialog for creating new :ref:`Script<class_Script>` files.
  10. Description
  11. -----------
  12. 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.
  13. ::
  14. func _ready():
  15. dialog.config("Node", "res://new_node.gd") # For in-engine types
  16. dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types
  17. dialog.popup_centered()
  18. Properties
  19. ----------
  20. +-------------------------------+-------------------+----------------------------------------------+
  21. | :ref:`bool<class_bool>` | dialog_hide_on_ok | ``false`` *(parent override)* |
  22. +-------------------------------+-------------------+----------------------------------------------+
  23. | :ref:`float<class_float>` | margin_bottom | ``232.0`` *(parent override)* |
  24. +-------------------------------+-------------------+----------------------------------------------+
  25. | :ref:`float<class_float>` | margin_right | ``361.0`` *(parent override)* |
  26. +-------------------------------+-------------------+----------------------------------------------+
  27. | :ref:`Vector2<class_Vector2>` | rect_size | ``Vector2( 361, 232 )`` *(parent override)* |
  28. +-------------------------------+-------------------+----------------------------------------------+
  29. | :ref:`String<class_String>` | window_title | ``"Attach Node Script"`` *(parent override)* |
  30. +-------------------------------+-------------------+----------------------------------------------+
  31. Methods
  32. -------
  33. +------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | 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, :ref:`bool<class_bool>` load_enabled=true **)** |
  35. +------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. Signals
  37. -------
  38. .. _class_ScriptCreateDialog_signal_script_created:
  39. - **script_created** **(** :ref:`Script<class_Script>` script **)**
  40. Emitted when the user clicks the OK button.
  41. Method Descriptions
  42. -------------------
  43. .. _class_ScriptCreateDialog_method_config:
  44. - void **config** **(** :ref:`String<class_String>` inherits, :ref:`String<class_String>` path, :ref:`bool<class_bool>` built_in_enabled=true, :ref:`bool<class_bool>` load_enabled=true **)**
  45. Prefills required fields to configure the ScriptCreateDialog for use.
  46. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  47. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  48. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`