ScriptCreateDialog

继承: ConfirmationDialog < AcceptDialog < Window < Viewport < Node < Object

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.


    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()

    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();
    }

属性

booldialog_hide_on_ok
Stringok_button_text
Stringtitle

方法

voidconfig ( inherits: String, path: String, built_in_enabled: bool = true, load_enabled: bool = true )

信号

script_created ( script: Script )

Emitted when the user clicks the OK button.


方法说明

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

Prefills required fields to configure the ScriptCreateDialog for use.

1

本方法通常需要用户覆盖才能生效。

2

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。