Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
EditorSpatialGizmoPlugin¶
Inherits: Resource < Reference < Object
Used by the editor to define Spatial gizmo types.
Descripción¶
EditorSpatialGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending EditorSpatialGizmoPlugin
for the simpler gizmos, or creating a new EditorSpatialGizmo type. See the tutorial in the documentation for more info.
Tutoriales¶
../tutorials/plugins/editor/spatial_gizmos
Métodos¶
void |
add_material ( String name, SpatialMaterial material ) |
can_be_hidden ( ) virtual |
|
void |
commit_handle ( EditorSpatialGizmo gizmo, int index, Variant restore, bool cancel=false ) virtual |
create_gizmo ( Spatial spatial ) virtual |
|
void |
create_handle_material ( String name, bool billboard=false, Texture texture=null ) |
void |
create_icon_material ( String name, Texture texture, bool on_top=false, Color color=Color( 1, 1, 1, 1 ) ) |
void |
create_material ( String name, Color color, bool billboard=false, bool on_top=false, bool use_vertex_color=false ) |
get_handle_name ( EditorSpatialGizmo gizmo, int index ) virtual |
|
get_handle_value ( EditorSpatialGizmo gizmo, int index ) virtual |
|
get_material ( String name, EditorSpatialGizmo gizmo=null ) |
|
get_name ( ) virtual |
|
get_priority ( ) virtual |
|
is_handle_highlighted ( EditorSpatialGizmo gizmo, int index ) virtual |
|
is_selectable_when_hidden ( ) virtual |
|
void |
redraw ( EditorSpatialGizmo gizmo ) virtual |
void |
set_handle ( EditorSpatialGizmo gizmo, int index, Camera camera, Vector2 point ) virtual |
Descripciones de Métodos¶
void add_material ( String name, SpatialMaterial material )
Añade un nuevo material a la lista de material interno para el plugin. Entonces se puede acceder a él con get_material. No debe ser sobreescrito.
Sobreescribe este método para definir si el gizmo puede ser escondido o no. Devuelve true
si no está sobrescrito.
void commit_handle ( EditorSpatialGizmo gizmo, int index, Variant restore, bool cancel=false ) virtual
Sobreescribe este método para confirmar los manejadores de los gizmos. Llamado por los gizmos activos de este plugin.
EditorSpatialGizmo create_gizmo ( Spatial spatial ) virtual
Override this method to return a custom EditorSpatialGizmo for the spatial nodes of your choice, return null
for the rest of nodes. See also has_gizmo.
Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with get_material and used in EditorSpatialGizmo.add_handles. Should not be overridden.
You can optionally provide a texture to use instead of the default icon.
void create_icon_material ( String name, Texture texture, bool on_top=false, Color color=Color( 1, 1, 1, 1 ) )
Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with get_material and used in EditorSpatialGizmo.add_unscaled_billboard. Should not be overridden.
void create_material ( String name, Color color, bool billboard=false, bool on_top=false, bool use_vertex_color=false )
Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with get_material and used in EditorSpatialGizmo.add_mesh and EditorSpatialGizmo.add_lines. Should not be overridden.
String get_handle_name ( EditorSpatialGizmo gizmo, int index ) virtual
Sobreescribir este método para proporcionar los nombres de los manejadores de los gizmos. Llamado por los gizmos activos de este plugin.
Variant get_handle_value ( EditorSpatialGizmo gizmo, int index ) virtual
Obtiene el valor real de un manejador de un aparato. Llamado por los gizmos activos de este plugin.
SpatialMaterial get_material ( String name, EditorSpatialGizmo gizmo=null )
Gets material from the internal list of materials. If an EditorSpatialGizmo is provided, it will try to get the corresponding variant (selected and/or editable).
String get_name ( ) virtual
Sobrescribe este método para proporcionar el nombre que aparecerá en el menú de visibilidad del gizmo.
int get_priority ( ) virtual
Sobreescribe este método para establecer la prioridad del aparato. Valores más altos corresponden a una prioridad más alta. Si un aparato con mayor prioridad entra en conflicto con otro aparato, sólo se utilizará el aparato con mayor prioridad.
Todos los artilugios de edición incorporados devuelven una prioridad de -1
. Si no se anula, este método devolverá 0
, lo que significa que los gizmos personalizados sobreescribiran automáticamente los gizmos incorporados.
Override this method to define which Spatial nodes have a gizmo from this plugin. Whenever a Spatial node is added to a scene this method is called, if it returns true
the node gets a generic EditorSpatialGizmo assigned and is added to this plugin's list of active gizmos.
bool is_handle_highlighted ( EditorSpatialGizmo gizmo, int index ) virtual
Averigua si un manejador está resaltado o no. Llamado por los gizmos activos de este plugin.
Override this method to define whether a Spatial with this gizmo should be selectable even when the gizmo is hidden.
void redraw ( EditorSpatialGizmo gizmo ) virtual
Llamada para redibujar el gizmo suministrado. Llamado por los gizmos activos de este plugin.
void set_handle ( EditorSpatialGizmo gizmo, int index, Camera camera, Vector2 point ) virtual
Actualizar el valor de un manejador después de haber sido actualizado. Llamado por los artilugios activos de este plugin.