NinePatchRect
Hereda: Control < CanvasItem < Node < Object
Un control que muestra una textura manteniendo sus esquinas intactas, pero embaldosando sus bordes y su centro.
Descripción
También conocido como paneles de 9 cortes, NinePatchRect produce paneles limpios de cualquier tamaño basados en una pequeña textura. Para ello, divide la textura en una cuadrícula de 3×3. Cuando escalas el nodo, se embaldosan los bordes de la textura horizontal o verticalmente, se embaldosa el centro en ambos ejes y se dejan las esquinas sin cambios.
Propiedades
|
||
|
||
|
||
mouse_filter |
|
|
|
||
|
||
|
||
|
||
|
||
Métodos
get_patch_margin(margin: Side) const |
|
void |
set_patch_margin(margin: Side, value: int) |
Señales
texture_changed() 🔗
Emitida cuando la textura del nodo cambia.
Enumeraciones
enum AxisStretchMode: 🔗
AxisStretchMode AXIS_STRETCH_MODE_STRETCH = 0
Estira la textura central a través del NinePatchRect. Esto puede causar que la textura se distorsione.
AxisStretchMode AXIS_STRETCH_MODE_TILE = 1
Repite la textura central a través del NinePatchRect. Esto no causará ninguna distorsión visible. La textura debe ser seamless para que esto funcione sin mostrar artefactos entre los bordes.
AxisStretchMode AXIS_STRETCH_MODE_TILE_FIT = 2
Repite la textura central a través del NinePatchRect, pero también estirará la textura para asegurarse de que cada tile sea visible por completo. Esto puede causar que la textura se distorsione, pero menos que AXIS_STRETCH_MODE_STRETCH. La textura debe ser seamless para que esto funcione sin mostrar artefactos entre los bordes.
Descripciones de Propiedades
AxisStretchMode axis_stretch_horizontal = 0 🔗
void set_h_axis_stretch_mode(value: AxisStretchMode)
AxisStretchMode get_h_axis_stretch_mode()
El modo de estiramiento a usar para el estiramiento/alineación horizontal.
AxisStretchMode axis_stretch_vertical = 0 🔗
void set_v_axis_stretch_mode(value: AxisStretchMode)
AxisStretchMode get_v_axis_stretch_mode()
El modo de estiramiento a usar para el estiramiento/alineación vertical.
Si es true, dibuja el centro del panel. Si no, sólo dibuja los bordes de los 9 cortes.
La altura de la fila inferior del 9-cortes. Un margen de 16 significa que las esquinas inferiores y el lado de los 9 cortes tendrán una altura de 16 píxeles. Puede establecer los 4 valores de margen individualmente para crear paneles con bordes no uniformes.
The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
Rect2 region_rect = Rect2(0, 0, 0, 0) 🔗
Región rectangular de la textura de la que tomar la muestra. Si trabajas con un atlas, usa esta propiedad para definir el área que el 9-cortes debe usar. Todas las demás propiedades son relativas a esta. Si el rectángulo está vacío, el NinePatchRect usará toda la textura.
El recurso de textura del nodo.
Descripciones de Métodos
int get_patch_margin(margin: Side) const 🔗
Devuelve el tamaño del margen en el Side especificado.
void set_patch_margin(margin: Side, value: int) 🔗
Establece el tamaño del margen en el Side especificado a value píxeles.