mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
278 lines
12 KiB
ReStructuredText
278 lines
12 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_TextureRect:
|
|
|
|
TextureRect
|
|
===========
|
|
|
|
**Hereda:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Un control que muestra una textura.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
Un control que muestra una textura, por ejemplo, un icono, dentro de una interfaz gráfica de usuario. La ubicación de la textura se puede controlar con la propiedad :ref:`stretch_mode<class_TextureRect_property_stretch_mode>`. Puede escalar, organizar en mosaico o permanecer centrada dentro de su rectángulo delimitador.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- `Demo de Vóxeles en 3D <https://godotengine.org/asset-library/asset/2755>`__
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+--------------------------------------------------+--------------------------------------------------------------+-----------------------------------------------------------------------+
|
|
| :ref:`ExpandMode<enum_TextureRect_ExpandMode>` | :ref:`expand_mode<class_TextureRect_property_expand_mode>` | ``0`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------+-----------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`flip_h<class_TextureRect_property_flip_h>` | ``false`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------+-----------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`flip_v<class_TextureRect_property_flip_v>` | ``false`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------+-----------------------------------------------------------------------+
|
|
| :ref:`MouseFilter<enum_Control_MouseFilter>` | mouse_filter | ``1`` (overrides :ref:`Control<class_Control_property_mouse_filter>`) |
|
|
+--------------------------------------------------+--------------------------------------------------------------+-----------------------------------------------------------------------+
|
|
| :ref:`StretchMode<enum_TextureRect_StretchMode>` | :ref:`stretch_mode<class_TextureRect_property_stretch_mode>` | ``0`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------+-----------------------------------------------------------------------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`texture<class_TextureRect_property_texture>` | |
|
|
+--------------------------------------------------+--------------------------------------------------------------+-----------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Enumeraciones
|
|
--------------------------
|
|
|
|
.. _enum_TextureRect_ExpandMode:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **ExpandMode**: :ref:`🔗<enum_TextureRect_ExpandMode>`
|
|
|
|
.. _class_TextureRect_constant_EXPAND_KEEP_SIZE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`ExpandMode<enum_TextureRect_ExpandMode>` **EXPAND_KEEP_SIZE** = ``0``
|
|
|
|
El tamaño mínimo será igual al tamaño de la textura, es decir, **TextureRect** no puede ser más pequeño que la textura.
|
|
|
|
.. _class_TextureRect_constant_EXPAND_IGNORE_SIZE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`ExpandMode<enum_TextureRect_ExpandMode>` **EXPAND_IGNORE_SIZE** = ``1``
|
|
|
|
El tamaño de la textura no se considerará para el cálculo del tamaño mínimo, por lo que el **TextureRect** puede reducirse más allá del tamaño de la textura.
|
|
|
|
.. _class_TextureRect_constant_EXPAND_FIT_WIDTH:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`ExpandMode<enum_TextureRect_ExpandMode>` **EXPAND_FIT_WIDTH** = ``2``
|
|
|
|
Se ignorará la altura de la textura. El ancho mínimo será igual a la altura actual. Útil para diseños horizontales, por ejemplo, dentro de :ref:`HBoxContainer<class_HBoxContainer>`.
|
|
|
|
.. _class_TextureRect_constant_EXPAND_FIT_WIDTH_PROPORTIONAL:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`ExpandMode<enum_TextureRect_ExpandMode>` **EXPAND_FIT_WIDTH_PROPORTIONAL** = ``3``
|
|
|
|
Igual que :ref:`EXPAND_FIT_WIDTH<class_TextureRect_constant_EXPAND_FIT_WIDTH>`, pero mantiene la relación de aspecto de la textura.
|
|
|
|
.. _class_TextureRect_constant_EXPAND_FIT_HEIGHT:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`ExpandMode<enum_TextureRect_ExpandMode>` **EXPAND_FIT_HEIGHT** = ``4``
|
|
|
|
Se ignorará el ancho de la textura. La altura mínima será igual al ancho actual. Útil para diseños verticales, por ejemplo, dentro de :ref:`VBoxContainer<class_VBoxContainer>`.
|
|
|
|
.. _class_TextureRect_constant_EXPAND_FIT_HEIGHT_PROPORTIONAL:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`ExpandMode<enum_TextureRect_ExpandMode>` **EXPAND_FIT_HEIGHT_PROPORTIONAL** = ``5``
|
|
|
|
Igual que :ref:`EXPAND_FIT_HEIGHT<class_TextureRect_constant_EXPAND_FIT_HEIGHT>`, pero mantiene la relación de aspecto de la textura.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _enum_TextureRect_StretchMode:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **StretchMode**: :ref:`🔗<enum_TextureRect_StretchMode>`
|
|
|
|
.. _class_TextureRect_constant_STRETCH_SCALE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`StretchMode<enum_TextureRect_StretchMode>` **STRETCH_SCALE** = ``0``
|
|
|
|
Escala para ajustarse al rectángulo delimitador del nodo.
|
|
|
|
.. _class_TextureRect_constant_STRETCH_TILE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`StretchMode<enum_TextureRect_StretchMode>` **STRETCH_TILE** = ``1``
|
|
|
|
Tile dentro del rectángulo delimitador del nodo.
|
|
|
|
.. _class_TextureRect_constant_STRETCH_KEEP:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`StretchMode<enum_TextureRect_StretchMode>` **STRETCH_KEEP** = ``2``
|
|
|
|
La textura mantiene su tamaño original y se mantiene en la esquina superior izquierda del rectángulo delimitador.
|
|
|
|
.. _class_TextureRect_constant_STRETCH_KEEP_CENTERED:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`StretchMode<enum_TextureRect_StretchMode>` **STRETCH_KEEP_CENTERED** = ``3``
|
|
|
|
La textura mantiene su tamaño original y permanece centrado en el rectángulo delimitador del nodo.
|
|
|
|
.. _class_TextureRect_constant_STRETCH_KEEP_ASPECT:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`StretchMode<enum_TextureRect_StretchMode>` **STRETCH_KEEP_ASPECT** = ``4``
|
|
|
|
Escala la textura para que se ajuste al rectángulo delimitador del nodo, pero mantén la relación de aspecto de la textura.
|
|
|
|
.. _class_TextureRect_constant_STRETCH_KEEP_ASPECT_CENTERED:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`StretchMode<enum_TextureRect_StretchMode>` **STRETCH_KEEP_ASPECT_CENTERED** = ``5``
|
|
|
|
Escala la textura para que se ajuste al rectángulo delimitador del nodo, céntrarlo y mantenga su relación de aspecto.
|
|
|
|
.. _class_TextureRect_constant_STRETCH_KEEP_ASPECT_COVERED:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`StretchMode<enum_TextureRect_StretchMode>` **STRETCH_KEEP_ASPECT_COVERED** = ``6``
|
|
|
|
Escala la textura para que el lado más corto se ajuste al rectángulo delimitador. El otro lado se ajusta a los límites del nodo.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_TextureRect_property_expand_mode:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`ExpandMode<enum_TextureRect_ExpandMode>` **expand_mode** = ``0`` :ref:`🔗<class_TextureRect_property_expand_mode>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_expand_mode**\ (\ value\: :ref:`ExpandMode<enum_TextureRect_ExpandMode>`\ )
|
|
- :ref:`ExpandMode<enum_TextureRect_ExpandMode>` **get_expand_mode**\ (\ )
|
|
|
|
**Experimental:** Using :ref:`EXPAND_FIT_WIDTH<class_TextureRect_constant_EXPAND_FIT_WIDTH>`, :ref:`EXPAND_FIT_WIDTH_PROPORTIONAL<class_TextureRect_constant_EXPAND_FIT_WIDTH_PROPORTIONAL>`, :ref:`EXPAND_FIT_HEIGHT<class_TextureRect_constant_EXPAND_FIT_HEIGHT>`, or :ref:`EXPAND_FIT_HEIGHT_PROPORTIONAL<class_TextureRect_constant_EXPAND_FIT_HEIGHT_PROPORTIONAL>` may result in unstable behavior in some :ref:`Container<class_Container>` controls. This behavior may be re-evaluated and changed in the future.
|
|
|
|
Define cómo se determina el tamaño mínimo en función del tamaño de la textura.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_TextureRect_property_flip_h:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **flip_h** = ``false`` :ref:`🔗<class_TextureRect_property_flip_h>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_flip_h**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_flipped_h**\ (\ )
|
|
|
|
Si es ``true``, la textura se voltea horizontalmente.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_TextureRect_property_flip_v:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **flip_v** = ``false`` :ref:`🔗<class_TextureRect_property_flip_v>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_flip_v**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_flipped_v**\ (\ )
|
|
|
|
Si es ``true``, la textura se voltea verticalmente.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_TextureRect_property_stretch_mode:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`StretchMode<enum_TextureRect_StretchMode>` **stretch_mode** = ``0`` :ref:`🔗<class_TextureRect_property_stretch_mode>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_stretch_mode**\ (\ value\: :ref:`StretchMode<enum_TextureRect_StretchMode>`\ )
|
|
- :ref:`StretchMode<enum_TextureRect_StretchMode>` **get_stretch_mode**\ (\ )
|
|
|
|
Controla el comportamiento de la textura al redimensionar el rectángulo delimitador del nodo.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_TextureRect_property_texture:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Texture2D<class_Texture2D>` **texture** :ref:`🔗<class_TextureRect_property_texture>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_texture**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
|
|
- :ref:`Texture2D<class_Texture2D>` **get_texture**\ (\ )
|
|
|
|
El recurso :ref:`Texture2D<class_Texture2D>` del nodo.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
|
|
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
|
|
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
|
|
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
|
|
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
|
|
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`
|