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.
Checking the stable version of the documentation...
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()
public override void _Ready()
{
var dialog = new ScriptCreateDialog();
dialog.Config("Node", "res://NewNode.cs"); // 对于引擎内置类型。
dialog.Config("\"res://BaseNode.cs\"", "res://DerivedNode.cs"); // 对于脚本类型。
dialog.PopupCentered();
}
属性¶
dialog_hide_on_ok |
|
|
ok_button_text |
|
|
title |
|
方法¶
void |
config ( String inherits, String path, bool built_in_enabled=true, bool load_enabled=true ) |
信号¶
script_created ( Script script )
当用户点击确定按钮时发出。
方法说明¶
void config ( String inherits, String path, bool built_in_enabled=true, bool load_enabled=true )
预填必填字段以配置 ScriptCreateDialog 以供使用。