ScriptCreateDialog

Inherits: ConfirmationDialog < AcceptDialog < Window < Viewport < Node < Object

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

Description

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.

GDScriptC#

  1. func _ready():
  2. var dialog = ScriptCreateDialog.new();
  3. dialog.config("Node", "res://new_node.gd") # For in-engine types.
  4. dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types.
  5. dialog.popup_centered()
  1. public override void _Ready()
  2. {
  3. var dialog = new ScriptCreateDialog();
  4. dialog.Config("Node", "res://NewNode.cs"); // For in-engine types.
  5. dialog.Config("\"res://BaseNode.cs\"", "res://DerivedNode.cs"); // For script types.
  6. dialog.PopupCentered();
  7. }

Properties

bool

dialog_hide_on_ok

false (overrides AcceptDialog)

String

ok_button_text

“Create” (overrides AcceptDialog)

String

title

“Attach Node Script” (overrides Window)

Methods

void

config ( String inherits, String path, bool built_in_enabled=true, bool load_enabled=true )


Signals

script_created ( Script script )

Emitted when the user clicks the OK button.


Method Descriptions

void config ( String inherits, String path, bool built_in_enabled=true, bool load_enabled=true )

Prefills required fields to configure the ScriptCreateDialog for use.

Previous Next


© Copyright 2014-present Juan Linietsky, Ariel Manzur and the Godot community (CC BY 3.0). Revision 53e837c6.

Built with Sphinx using a theme provided by Read the Docs.