ScriptCreateDialog

Inherits: ConfirmationDialog < AcceptDialog < WindowDialog < Popup < Control < CanvasItem < Node < Object

用于创建新 Script 文件的编辑器弹出对话框。

描述

ScriptCreateDialog 根据指定脚本语言的特定模板创建脚本文件。标准用法是在类似调用 Popup.popup 方法之前配置其字段。

  1. func _ready():
  2. dialog.config("Node", "res://new_node.gd") # For in-engine types
  3. dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types
  4. dialog.popup_centered()

属性

bool

dialog_hide_on_ok

false (overrides AcceptDialog)

float

margin_bottom

258.0 (overrides Control)

float

margin_right

366.0 (overrides Control)

Vector2

rect_size

Vector2( 366, 258 ) (overrides Control)

String

window_title

“Attach Node Script” (overrides WindowDialog)

方法

void

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

信号

  • script_created ( Script script )

当用户点击OK按钮时发出。

方法说明

预填必填字段以配置 ScriptCreateDialog 以供使用。