EditorInterface¶
La interfaz del editor de Godot.
Descripción¶
EditorInterface te da el control sobre la ventana del editor de Godot. Permite personalizar la ventana, guardar y (re)cargar escenas, renderizar vistas previas de la malla, inspeccionar y editar recursos y objetos, y proporciona acceso a EditorSettings, EditorFileSystem, EditorResourcePreview, ScriptEditor, la vista del editor e información sobre las escenas.
Nota: Esta clase no debe ser instanciada directamente. En lugar de eso, accede al singleton usando el EditorPlugin.get_editor_interface.
Propiedades¶
Métodos¶
void |
|
void |
edit_resource ( Resource resource ) |
void |
edit_script ( Script script, int line=-1, int column=0, bool grab_focus=true ) |
get_base_control ( ) |
|
get_current_path ( ) const |
|
get_editor_scale ( ) const |
|
get_inspector ( ) const |
|
get_open_scenes ( ) const |
|
get_playing_scene ( ) const |
|
get_selected_path ( ) const |
|
get_selection ( ) |
|
void |
inspect_object ( Object object, String for_property="", bool inspector_only=false ) |
is_playing_scene ( ) const |
|
is_plugin_enabled ( String plugin ) const |
|
make_mesh_previews ( Array meshes, int preview_size ) |
|
void |
open_scene_from_path ( String scene_filepath ) |
void |
|
void |
play_custom_scene ( String scene_filepath ) |
void |
play_main_scene ( ) |
void |
reload_scene_from_path ( String scene_filepath ) |
save_scene ( ) |
|
void |
save_scene_as ( String path, bool with_preview=true ) |
void |
select_file ( String file ) |
void |
set_main_screen_editor ( String name ) |
void |
set_plugin_enabled ( String plugin, bool enabled ) |
void |
Descripciones de Propiedades¶
bool distraction_free_mode
Setter |
set_distraction_free_mode(value) |
Getter |
is_distraction_free_mode_enabled() |
Si true
, permite el modo libre de distracción que oculta los muelles laterales para aumentar el espacio disponible para la vista principal.
Descripciones de Métodos¶
void edit_node ( Node node )
Edits the given Node. The node will be also selected if it's inside the scene tree.
void edit_resource ( Resource resource )
Edits the given Resource. If the resource is a Script you can also edit it with edit_script to specify the line and column position.
Edits the given Script. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor.
Control get_base_control ( )
Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly.
Warning: Removing and freeing this node will render the editor useless and may cause a crash.
String get_current_path ( ) const
Devuelve la ruta actual que se está viendo en el FileSystemDock.
Node get_edited_scene_root ( )
Devuelve la raíz de la escena editada (actual) Node.
float get_editor_scale ( ) const
Returns the actual scale of the editor UI (1.0
being 100% scale). This can be used to adjust position and dimensions of the UI added by plugins.
Note: This value is set via the interface/editor/display_scale
and interface/editor/custom_display_scale
editor settings. Editor must be restarted for changes to be properly applied.
EditorSettings get_editor_settings ( )
Devuelve la instancia del editor EditorSettings.
Control get_editor_viewport ( )
Returns the main editor control. Use this as a parent for main screens.
Note: This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically.
Warning: Removing and freeing this node will render a part of the editor useless and may cause a crash.
FileSystemDock get_file_system_dock ( )
Returns the editor's FileSystemDock instance.
Warning: Removing and freeing this node will render a part of the editor useless and may cause a crash.
EditorInspector get_inspector ( ) const
Returns the editor's EditorInspector instance.
Warning: Removing and freeing this node will render a part of the editor useless and may cause a crash.
Array get_open_scenes ( ) const
Devuelve una Array con las rutas de archivo de las escenas abiertas actualmente.
String get_playing_scene ( ) const
Devuelve el nombre de la escena que se está reproduciendo. Si no se está reproduciendo ninguna escena, devuelve una string vacía.
EditorFileSystem get_resource_filesystem ( )
Devuelve la instancia del editor EditorFileSystem.
EditorResourcePreview get_resource_previewer ( )
Devuelve la instancia del editor EditorResourcePreview.
ScriptEditor get_script_editor ( )
Returns the editor's ScriptEditor instance.
Warning: Removing and freeing this node will render a part of the editor useless and may cause a crash.
String get_selected_path ( ) const
Devuelve la ruta del directorio actualmente seleccionado en el FileSystemDock. Si se selecciona un archivo, su directorio base será devuelto usando el String.get_base_dir en su lugar.
EditorSelection get_selection ( )
Devuelve la instancia del editor EditorSelection.
Shows the given property on the given object
in the editor's Inspector dock. If inspector_only
is true
, plugins will not attempt to edit object
.
bool is_playing_scene ( ) const
Devuelve true
si se está reproduciendo una escena, false
en caso contrario. Las escenas en pausa se consideran como si estuvieran siendo reproducidas.
Devuelve true
si el plugin
especificado está activado. El nombre del plugin es el mismo que su nombre de directorio.
Returns mesh previews rendered at the given size as an Array of Textures.
void open_scene_from_path ( String scene_filepath )
Abre la escena en de la ruta dada.
void play_current_scene ( )
Reproduce la escena actualmente activa.
void play_custom_scene ( String scene_filepath )
Reproduce la escena especificada por su ruta de acceso.
void play_main_scene ( )
Reproduce la escena principal.
void reload_scene_from_path ( String scene_filepath )
Recarga la escena de la ruta dada.
Error save_scene ( )
Guarda la escena. Devuelve OK
o ERR_CANT_CREATE
(ver las constantes de @GlobalScope).
Guarda la escena como un archivo en path
.
void select_file ( String file )
Selecciona el archivo, con la ruta proporcionada por file
, en el dock de archivos del sistema.
void set_main_screen_editor ( String name )
Establece la pantalla principal actual del editor a la especificada en name
. name
debe coincidir exactamente con el texto de la pestaña en cuestión (2D
, 3D
, Script
, AssetLib
).
Establece el estado habilitado de un plugin. El nombre del plugin es el mismo que su nombre de directorio.
void stop_playing_scene ( )
Detiene la escena que se está reproduciendo actualmente.