GraphNode¶
Inherits: Container < Control < CanvasItem < Node < Object
Un GraphNode es un contenedor con potencialmente varias ranuras de entrada y salida que permiten conexiones entre los GraphNodes. Las ranuras pueden tener tipos diferentes e incompatibles.
Descripción¶
A GraphNode is a container. Each GraphNode can have several input and output slots, sometimes referred to as ports, allowing connections between GraphNodes. To add a slot to GraphNode, add any Control-derived child node to it.
After adding at least one child to GraphNode new sections will be automatically created in the Inspector called 'Slot'. When 'Slot' is expanded you will see list with index number for each slot. You can click on each of them to expand further.
In the Inspector you can enable (show) or disable (hide) slots. By default, all slots are disabled so you may not see any slots on your GraphNode initially. You can assign a type to each slot. Only slots of the same type will be able to connect to each other. You can also assign colors to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input connections are on the left and output connections are on the right side of GraphNode. Only enabled slots are counted as connections.
Propiedades¶
|
||
|
||
|
||
|
||
|
||
|
||
|
Métodos¶
Propiedades del Theme¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Señales¶
close_request ( )
Emitido cuando se solicita el cierre del GraphNode. Ocurre al hacer clic en el botón de cierre (ver show_close).
Se emite cuando se arrastra el GraphNode.
offset_changed ( )
Emitido cuando se mueve el GraphNode.
raise_request ( )
Emitido cuando se solicita que el GraphNode se muestre sobre otros. Ocurre al enfocar (hacer clic en) el GraphNode.
resize_request ( Vector2 new_minsize )
Emitido cuando se pide que el GraphNode sea redimensionado. Ocurre al arrastrar el mango de redimensionamiento (ver resizable).
slot_updated ( int idx )
Emitted when any GraphNode's slot is updated.
Enumeraciones¶
enum Overlay:
OVERLAY_DISABLED = 0 --- No se muestra ninguna capa superpuesta.
OVERLAY_BREAKPOINT = 1 --- Muestra la capa superpuesta establecida en la propiedad del tema
breakpoint
.OVERLAY_POSITION = 2 --- Muestra la capa superpuesta establecida en la propiedad del tema
position
.
Descripciones de Propiedades¶
bool comment
Default |
|
Setter |
set_comment(value) |
Getter |
is_comment() |
Si true
, el GraphNode es un nodo de comentario.
Vector2 offset
Default |
|
Setter |
set_offset(value) |
Getter |
get_offset() |
El desplazamiento del GraphNode, relativo al desplazamiento del GraphEdit.
Nota: No puedes usar la posición directamente, ya que GraphEdit es un Container.
Overlay overlay
Default |
|
Setter |
set_overlay(value) |
Getter |
get_overlay() |
Establece la superposición que se muestra sobre el GraphNode. Ver Overlay.
bool resizable
Default |
|
Setter |
set_resizable(value) |
Getter |
is_resizable() |
Si true
, el usuario puede cambiar el tamaño del GraphNode.
Nota: Arrastrando el manejador sólo se emitirá la señal resize_request, el GraphNode necesita ser redimensionado manualmente.
bool selected
Default |
|
Setter |
set_selected(value) |
Getter |
is_selected() |
Si true
, se selecciona el GraphNode.
bool show_close
Default |
|
Setter |
set_show_close_button(value) |
Getter |
is_close_button_visible() |
Si true
, el botón de cerrado será visible.
Nota: Al pulsarlo sólo se emitirá la señal close_request, el GraphNode debe ser eliminado manualmente.
String title
Default |
|
Setter |
set_title(value) |
Getter |
get_title() |
El texto que se muestra en la barra de título del GraphNode.
Descripciones de Métodos¶
void clear_all_slots ( )
Deshabilita todas las ranuras de entrada y salida del GraphNode.
void clear_slot ( int idx )
Desactiva la ranura de entrada y salida cuyo índice es idx
.
Returns the Color of the input connection idx
.
int get_connection_input_count ( )
Devuelve el número de ranuras de entrada (conexiones) habilitadas al GraphNode.
Devuelve la posición de la conexión de entrada idx
.
Devuelve el tipo de la conexión de entrada idx
.
Returns the Color of the output connection idx
.
int get_connection_output_count ( )
Devuelve el número de ranuras de salida (conexiones) habilitadas del GraphNode.
Devuelve la posición de la conexión de salida idx
.
Devuelve el tipo de la conexión de salida idx
.
Returns the left (input) Color of the slot idx
.
Returns the right (output) Color of the slot idx
.
Returns the left (input) type of the slot idx
.
Returns the right (output) type of the slot idx
.
Returns true
if left (input) side of the slot idx
is enabled.
Returns true
if right (output) side of the slot idx
is enabled.
void set_slot ( int idx, bool enable_left, int type_left, Color color_left, bool enable_right, int type_right, Color color_right, Texture custom_left=null, Texture custom_right=null )
Sets properties of the slot with ID idx
.
If enable_left
/right
, a port will appear and the slot will be able to be connected from this side.
type_left
/right
is an arbitrary type of the port. Only ports with the same type values can be connected.
color_left
/right
is the tint of the port's icon on this side.
custom_left
/right
is a custom texture for this side's port.
Note: This method only sets properties of the slot. To create the slot, add a Control-derived child to the GraphNode.
Individual properties can be set using one of the set_slot_*
methods. You must enable at least one side of the slot to do so.
Sets the Color of the left (input) side of the slot idx
to color_left
.
Sets the Color of the right (output) side of the slot idx
to color_right
.
Toggles the left (input) side of the slot idx
. If enable_left
is true
, a port will appear on the left side and the slot will be able to be connected from this side.
Toggles the right (output) side of the slot idx
. If enable_right
is true
, a port will appear on the right side and the slot will be able to be connected from this side.
Sets the left (input) type of the slot idx
to type_left
.
Sets the right (output) type of the slot idx
to type_right
.
Theme Property Descriptions¶
Color close_color
Default |
|
La modulación de color aplicada al icono del botón de cierre.
Color resizer_color
Default |
|
La modulación de color aplicada al icono de redimensionamiento.
Color title_color
Default |
|
El color del texto del título.
int close_offset
Default |
|
El desplazamiento vertical del botón de cierre.
int port_offset
Default |
|
Desplazamiento horizontal de los puertos.
int separation
Default |
|
La distancia vertical entre los puertos.
int title_offset
Default |
|
Desplazamiento vertical del texto del título.
Font title_font
Fuente usada para el texto del título.
Texture close
El icono del botón de cierre, visible cuando show_close está activado.
Texture port
El icono utilizado para representar los puertos.
Texture resizer
El icono utilizado para el redimensionamiento, visible cuando está activado el resizable.
StyleBox breakpoint
El fondo utilizado cuando overlay se establece en OVERLAY_BREAKPOINT.
StyleBox comment
El StyleBox utilizado cuando el comment está activado.
StyleBox commentfocus
El StyleBox utilizado cuando el comment está habilitado y el GraphNode
está enfocado.
StyleBox defaultfocus
StyleBox defaultframe
StyleBox frame
El fondo por defecto para GraphNode
.
StyleBox position
El fondo utilizado cuando overlay se establece en OVERLAY_POSITION.
StyleBox selectedframe
El fondo utilizado cuando se selecciona el GraphNode
.