ScriptEditor¶
Inherits: PanelContainer < Container < Control < CanvasItem < Node < Object
Godot编辑器的脚本编辑器。
描述¶
注意: 这个类不应该被直接实例化。相反,使用EditorInterface.get_script_editor来访问这个单例。
方法¶
can_drop_data_fw ( Vector2 point, Variant data, Control from ) const |
|
void |
drop_data_fw ( Vector2 point, Variant data, Control from ) |
get_drag_data_fw ( Vector2 point, Control from ) |
|
get_open_scripts ( ) const |
|
void |
|
void |
open_script_create_dialog ( String base_name, String base_path ) |
信号¶
editor_script_changed ( Script script )
当用户更改活动脚本时发出。参数是新激活的 Script。
script_close ( Script script )
当编辑器即将关闭活动脚本时发出。参数是将要关闭的 Script。
方法说明¶
Script get_current_script ( )
返回当前在编辑器中处于活动状态的 Script。
Array get_open_scripts ( ) const
返回一个包含当前在编辑器中打开的所有 Script 对象的数组。
void goto_line ( int line_number )
转到当前脚本中的指定行。
打开创建脚本的对话框。脚本将扩展base_name
。文件扩展名可以从base_path
中省略。它将根据所选择的脚本语言添加。