Inheritance #

ScriptCreateDialog
Table of contents

ScriptCreateDialog #

is_instantiable, Node, editor, not_builtin_classes

Godot editor's popup dialog for creating new Script files.

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 Window.popup methods.

GDScript

func _ready():
    var dialog = ScriptCreateDialog.new();
    dialog.config("Node", "res://new_node.gd") # For in-engine types.
    dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types.
    dialog.popup_centered()

C#

public override void _Ready()
{
    var dialog = new ScriptCreateDialog();
    dialog.Config("Node", "res://NewNode.cs"); // For in-engine types.
    dialog.Config("\"res://BaseNode.cs\"", "res://DerivedNode.cs"); // For script types.
    dialog.PopupCentered();
}

Members #

var dialog_hide_on_ok: bool = false#

var ok_button_text: String = "Create"#

var title: String = "Attach Node Script"#

Methods #

func config(load_enabled: bool = true) -> void#

Prefills required fields to configure the ScriptCreateDialog for use.

Annotations #

Constants #

Constructors #

Enums #

Operators #

Signals #

signal script_created(script: Script)#

Emitted when the user clicks the OK button.

Theme Items #

Tutorials #