mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-02 21:48:52 +03:00
273 lines
16 KiB
ReStructuredText
273 lines
16 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_ScriptEditor:
|
|
|
|
ScriptEditor
|
|
============
|
|
|
|
**Eredita:** :ref:`PanelContainer<class_PanelContainer>` **<** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Editor di script dell'editor Godot.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descrizione
|
|
----------------------
|
|
|
|
Editor di script dell'editor Godot.
|
|
|
|
\ **Nota:** Questa classe non dovrebbe essere istanziata direttamente. Invece, accedi al singleton usando :ref:`EditorInterface.get_script_editor()<class_EditorInterface_method_get_script_editor>`.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Metodi
|
|
------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`clear_docs_from_script<class_ScriptEditor_method_clear_docs_from_script>`\ (\ script\: :ref:`Script<class_Script>`\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_breakpoints<class_ScriptEditor_method_get_breakpoints>`\ (\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`ScriptEditorBase<class_ScriptEditorBase>` | :ref:`get_current_editor<class_ScriptEditor_method_get_current_editor>`\ (\ ) |const| |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Script<class_Script>` | :ref:`get_current_script<class_ScriptEditor_method_get_current_script>`\ (\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Array<class_Array>`\[:ref:`ScriptEditorBase<class_ScriptEditorBase>`\] | :ref:`get_open_script_editors<class_ScriptEditor_method_get_open_script_editors>`\ (\ ) |const| |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Array<class_Array>`\[:ref:`Script<class_Script>`\] | :ref:`get_open_scripts<class_ScriptEditor_method_get_open_scripts>`\ (\ ) |const| |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`goto_help<class_ScriptEditor_method_goto_help>`\ (\ topic\: :ref:`String<class_String>`\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`goto_line<class_ScriptEditor_method_goto_line>`\ (\ line_number\: :ref:`int<class_int>`\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`open_script_create_dialog<class_ScriptEditor_method_open_script_create_dialog>`\ (\ base_name\: :ref:`String<class_String>`, base_path\: :ref:`String<class_String>`\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`register_syntax_highlighter<class_ScriptEditor_method_register_syntax_highlighter>`\ (\ syntax_highlighter\: :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>`\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`unregister_syntax_highlighter<class_ScriptEditor_method_unregister_syntax_highlighter>`\ (\ syntax_highlighter\: :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>`\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`update_docs_from_script<class_ScriptEditor_method_update_docs_from_script>`\ (\ script\: :ref:`Script<class_Script>`\ ) |
|
|
+------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Segnali
|
|
--------------
|
|
|
|
.. _class_ScriptEditor_signal_editor_script_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**editor_script_changed**\ (\ script\: :ref:`Script<class_Script>`\ ) :ref:`🔗<class_ScriptEditor_signal_editor_script_changed>`
|
|
|
|
Emesso quando l'utente ha modificato lo script attivo. L'argomento è uno :ref:`Script<class_Script>` appena attivato.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_signal_script_close:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**script_close**\ (\ script\: :ref:`Script<class_Script>`\ ) :ref:`🔗<class_ScriptEditor_signal_script_close>`
|
|
|
|
Emesso quando l'editor sta per chiudere lo script attivo. L'argomento è uno :ref:`Script<class_Script>` che sta per essere chiuso.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descrizioni dei metodi
|
|
--------------------------------------------
|
|
|
|
.. _class_ScriptEditor_method_clear_docs_from_script:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **clear_docs_from_script**\ (\ script\: :ref:`Script<class_Script>`\ ) :ref:`🔗<class_ScriptEditor_method_clear_docs_from_script>`
|
|
|
|
Rimuove la documentazione per lo ``script`` specificato.
|
|
|
|
\ **Nota:** Questo dovrebbe essere chiamato ogni volta che lo script viene modificato per mantenere aggiornato lo stato della documentazione aperta.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_get_breakpoints:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`PackedStringArray<class_PackedStringArray>` **get_breakpoints**\ (\ ) :ref:`🔗<class_ScriptEditor_method_get_breakpoints>`
|
|
|
|
Restituisce un array di punti d'interruzione.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_get_current_editor:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`ScriptEditorBase<class_ScriptEditorBase>` **get_current_editor**\ (\ ) |const| :ref:`🔗<class_ScriptEditor_method_get_current_editor>`
|
|
|
|
Restituisce l'oggetto :ref:`ScriptEditorBase<class_ScriptEditorBase>` che l'utente sta attualmente modificando.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_get_current_script:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Script<class_Script>` **get_current_script**\ (\ ) :ref:`🔗<class_ScriptEditor_method_get_current_script>`
|
|
|
|
Restituisce uno :ref:`Script<class_Script>` che è attualmente attivo nell'editor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_get_open_script_editors:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Array<class_Array>`\[:ref:`ScriptEditorBase<class_ScriptEditorBase>`\] **get_open_script_editors**\ (\ ) |const| :ref:`🔗<class_ScriptEditor_method_get_open_script_editors>`
|
|
|
|
Restituisce un array con tutti gli oggetti :ref:`ScriptEditorBase<class_ScriptEditorBase>` che sono attualmente aperti nell'editor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_get_open_scripts:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Array<class_Array>`\[:ref:`Script<class_Script>`\] **get_open_scripts**\ (\ ) |const| :ref:`🔗<class_ScriptEditor_method_get_open_scripts>`
|
|
|
|
Restituisce un array con tutti gli oggetti :ref:`Script<class_Script>` che sono attualmente aperti nell'editor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_goto_help:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **goto_help**\ (\ topic\: :ref:`String<class_String>`\ ) :ref:`🔗<class_ScriptEditor_method_goto_help>`
|
|
|
|
Apre la guida per l'argomento specificato. Il ``topic`` è una stringa codificata che controlla quale classe, metodo, costante, segnale, annotazione, proprietà o elemento del tema deve essere focalizzato.
|
|
|
|
I formati ``topic`` supportati includono ``class_name:class``, ``class_method:class:method``, ``class_constant:class:constant``, ``class_signal:class:signal``, ``class_annotation:class:@annotation``, ``class_property:class:property`` e ``class_theme_item:class:item``, dove ``class`` è il nome di una classe, ``method`` è il nome di un metodo, ``constant`` è il nome di una costante, ``signal`` è il nome di un segnale, ``annotation`` è il nome di un'annotazione, ``property`` è il nome di una proprietà e ``item`` è un elemento del tema.
|
|
|
|
::
|
|
|
|
# Mostra la guida per la classe Node.
|
|
class_name:Node
|
|
# Mostra la guida per la funzione globale min.
|
|
# Gli oggetti globali sono accessibili nello spazio dei nomi `@GlobalScope`, mostrato qui.
|
|
class_method:@GlobalScope:min
|
|
# Mostra la guida per get_viewport nella classe Node.
|
|
class_method:Node:get_viewport
|
|
# Mostra la guida per la costante di input MOUSE_BUTTON_MIDDLE.
|
|
class_constant:Input:MOUSE_BUTTON_MIDDLE
|
|
# Mostra la guida per il segnale BaseButton premuto.
|
|
class_signal:BaseButton:pressed
|
|
# Mostra la guida per la proprietà CanvasItem visible.
|
|
class_property:CanvasItem:visible
|
|
# Mostra la guida per l'annotazione GDScript export.
|
|
# Le annotazioni devono essere precedute dal simbolo `@` nel descrittore, come mostrato qui.
|
|
class_annotation:@GDScript:@export
|
|
# Mostra la guida per l'elemento del tema GraphNode con il nome panel_selected.
|
|
class_theme_item:GraphNode:panel_selected
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_goto_line:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **goto_line**\ (\ line_number\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ScriptEditor_method_goto_line>`
|
|
|
|
Va alla riga specificata nello script attuale.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_open_script_create_dialog:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **open_script_create_dialog**\ (\ base_name\: :ref:`String<class_String>`, base_path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_ScriptEditor_method_open_script_create_dialog>`
|
|
|
|
Apre la finestra di dialogo di creazione dello script. Lo script estenderà ``base_name``. L'estensione del file può essere omessa dal percorso ``base_path``. Sarà aggiunta in base al linguaggio di scripting selezionato.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_register_syntax_highlighter:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **register_syntax_highlighter**\ (\ syntax_highlighter\: :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>`\ ) :ref:`🔗<class_ScriptEditor_method_register_syntax_highlighter>`
|
|
|
|
Registra l':ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` nell'editor, l':ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` sarà disponibile su tutti gli script aperti.
|
|
|
|
\ **Nota:** Non si applica agli script che sono già aperti.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_unregister_syntax_highlighter:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **unregister_syntax_highlighter**\ (\ syntax_highlighter\: :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>`\ ) :ref:`🔗<class_ScriptEditor_method_unregister_syntax_highlighter>`
|
|
|
|
Annulla la registrazione del :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` dall'editor.
|
|
|
|
\ **Nota:** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` sarà comunque applicato agli script che sono già aperti.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ScriptEditor_method_update_docs_from_script:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **update_docs_from_script**\ (\ script\: :ref:`Script<class_Script>`\ ) :ref:`🔗<class_ScriptEditor_method_update_docs_from_script>`
|
|
|
|
Aggiorna la documentazione per lo ``script`` specificato.
|
|
|
|
\ **Nota:** Questo dovrebbe essere chiamato ogni volta che lo script viene modificato per mantenere aggiornato lo stato della documentazione aperta.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (Questo metodo dovrebbe solitamente essere sovrascritto dall'utente per aver un effetto.)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (Questo metodo non ha effetti collaterali. Non modifica alcuna variabile appartenente all'istanza.)`
|
|
.. |vararg| replace:: :abbr:`vararg (Questo metodo accetta qualsiasi numero di argomenti oltre a quelli descritti qui.)`
|
|
.. |constructor| replace:: :abbr:`constructor (Questo metodo è utilizzato per creare un tipo.)`
|
|
.. |static| replace:: :abbr:`static (Questo metodo non necessita di alcun'istanza per essere chiamato, quindi può essere chiamato direttamente usando il nome della classe.)`
|
|
.. |operator| replace:: :abbr:`operator (Questo metodo descrive un operatore valido da usare con questo tipo come operando di sinistra.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (Questo valore è un intero composto da una maschera di bit dei seguenti flag.)`
|
|
.. |void| replace:: :abbr:`void (Nessun valore restituito.)`
|