Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

ScriptCreateDialog

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

Godot 編輯器用於建立新 Script 檔的彈出對話方塊。

說明

ScriptCreateDialog 會根據給定的範本為給定的指令碼語言建立指令檔。標準用法是在呼叫任何 Window.popup() 方法之前,先配置其欄位。

func _ready():
    var dialog = ScriptCreateDialog.new();
    dialog.config("Node", "res://new_node.gd") # 對於引擎內建型別。
    dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # 對於腳本型別。
    dialog.popup_centered()

屬性

bool

dialog_hide_on_ok

false (overrides AcceptDialog)

String

ok_button_text

"Create" (overrides AcceptDialog)

String

title

"Attach Node Script" (overrides Window)

方法

void

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


訊號

script_created(script: Script) 🔗

當使用者點擊確定按鈕時發出。


方法說明

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

預填必填欄位以配置 ScriptCreateDialog 以供使用。