ScriptEditor

Hereda: PanelContainer < Container < Control < CanvasItem < Node < Object

El editor de script de Godot.

Descripción

Editor de scripts del editor de Godot.

Nota: Esta clase no debe instanciarse directamente. En su lugar, accede al singleton usando EditorInterface.get_script_editor().

Métodos

void

clear_docs_from_script(script: Script)

PackedStringArray

get_breakpoints()

ScriptEditorBase

get_current_editor() const

Script

get_current_script()

Array[ScriptEditorBase]

get_open_script_editors() const

Array[Script]

get_open_scripts() const

void

goto_help(topic: String)

void

goto_line(line_number: int)

void

open_script_create_dialog(base_name: String, base_path: String)

void

register_syntax_highlighter(syntax_highlighter: EditorSyntaxHighlighter)

void

unregister_syntax_highlighter(syntax_highlighter: EditorSyntaxHighlighter)

void

update_docs_from_script(script: Script)


Señales

editor_script_changed(script: Script) 🔗

Emitida cuando el usuario cambia el script activo. El argumento es un Script recién activado.


script_close(script: Script) 🔗

Emitida cuando el editor está a punto de cerrar el script activo. El argumento es un Script que va a ser cerrado.


Descripciones de Métodos

void clear_docs_from_script(script: Script) 🔗

Elimina la documentación para el script dado.

Nota: Esto debería llamarse siempre que se cambie el script para mantener el estado de la documentación abierto actualizado.


PackedStringArray get_breakpoints() 🔗

Devuelve un array de puntos de interrupción.


ScriptEditorBase get_current_editor() const 🔗

Devuelve el objeto ScriptEditorBase que el usuario está editando actualmente.


Script get_current_script() 🔗

Devuelve un Script que está actualmente activo en el editor.


Array[ScriptEditorBase] get_open_script_editors() const 🔗

Devuelve un array con todos los objetos ScriptEditorBase que están abiertos actualmente en el editor.


Array[Script] get_open_scripts() const 🔗

Devuelve un array con todos los objetos Script que están actualmente abiertos en el editor.


void goto_help(topic: String) 🔗

Opens help for the given topic. The topic is an encoded string that controls which class, method, constant, signal, annotation, property, or theme item should be focused.

The supported topic formats include class_name:class, class_method:class:method, class_constant:class:constant, class_signal:class:signal, class_annotation:class:@annotation, class_property:class:property, and class_theme_item:class:item, where class is the class name, method is the method name, constant is the constant name, signal is the signal name, annotation is the annotation name, property is the property name, and item is the theme item.

# Shows help for the Node class.
class_name:Node
# Shows help for the global min function.
# Global objects are accessible in the `@GlobalScope` namespace, shown here.
class_method:@GlobalScope:min
# Shows help for get_viewport in the Node class.
class_method:Node:get_viewport
# Shows help for the Input constant MOUSE_BUTTON_MIDDLE.
class_constant:Input:MOUSE_BUTTON_MIDDLE
# Shows help for the BaseButton signal pressed.
class_signal:BaseButton:pressed
# Shows help for the CanvasItem property visible.
class_property:CanvasItem:visible
# Shows help for the GDScript annotation export.
# Annotations should be prefixed with the `@` symbol in the descriptor, as shown here.
class_annotation:@GDScript:@export
# Shows help for the GraphNode theme item named panel_selected.
class_theme_item:GraphNode:panel_selected

void goto_line(line_number: int) 🔗

Va a la línea especificada en el script actual.


void open_script_create_dialog(base_name: String, base_path: String) 🔗

Abre el diálogo de creación de scripts. El script extenderá base_name. La extensión del archivo puede omitirse de base_path. Se agregará según el lenguaje de scripting seleccionado.


void register_syntax_highlighter(syntax_highlighter: EditorSyntaxHighlighter) 🔗

Registra el EditorSyntaxHighlighter en el editor, el EditorSyntaxHighlighter estará disponible en todos los scripts abiertos.

Nota: No se aplica a los scripts que ya están abiertos.


void unregister_syntax_highlighter(syntax_highlighter: EditorSyntaxHighlighter) 🔗

Anula el registro del EditorSyntaxHighlighter del editor.

Nota: El EditorSyntaxHighlighter seguirá aplicándose a los scripts que ya están abiertos.


void update_docs_from_script(script: Script) 🔗

Actualiza la documentación para el script dado.

Nota: Esto debe llamarse cada vez que se cambie el script para mantener el estado de la documentación abierto actualizado.