mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-02 21:48:52 +03:00
Currently including `zh_CN` and `es` which both have very high completion ratios. Others will be added once they reach a significant percentage too. These RST files will be used by godot-docs in place of its `classes` folder after we sync with https://github.com/godotengine/godot-docs/pull/5458. The update workflow is manual for now (example for `zh_CN`): - Build `godotengine/godot` in the branch we currently track (now `3.x`) - Run `godot --doctool -l zh_CN` - Run `cd doc && make rst LANGARG=zh_CN` - Copy `doc/_build/rst/*` to `classes/zh_CN/` here - Make sure to have `classes/zh_CN/index.rst` copied from `docs/classes`
242 lines
11 KiB
ReStructuredText
242 lines
11 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the TextureButton.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_TextureButton:
|
|
|
|
TextureButton
|
|
=============
|
|
|
|
**Inherits:** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Botón basado en la textura. Soporta los estados de Presionado, Cursor Encima, Desactivado y Enfocado.
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
``TextureButton`` has the same functionality as :ref:`Button<class_Button>`, except it uses sprites instead of Godot's :ref:`Theme<class_Theme>` resource. It is faster to create, but it doesn't support localization like more complex :ref:`Control<class_Control>`\ s.
|
|
|
|
The "normal" state must contain a texture (:ref:`texture_normal<class_TextureButton_property_texture_normal>`); other textures are optional.
|
|
|
|
See also :ref:`BaseButton<class_BaseButton>` which contains common properties and methods associated with this node.
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- `3D Voxel Demo <https://godotengine.org/asset-library/asset/676>`__
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`expand<class_TextureButton_property_expand>` | ``false`` |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`flip_h<class_TextureButton_property_flip_h>` | ``false`` |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`flip_v<class_TextureButton_property_flip_v>` | ``false`` |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`StretchMode<enum_TextureButton_StretchMode>` | :ref:`stretch_mode<class_TextureButton_property_stretch_mode>` | ``0`` |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`BitMap<class_BitMap>` | :ref:`texture_click_mask<class_TextureButton_property_texture_click_mask>` | |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`Texture<class_Texture>` | :ref:`texture_disabled<class_TextureButton_property_texture_disabled>` | |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`Texture<class_Texture>` | :ref:`texture_focused<class_TextureButton_property_texture_focused>` | |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`Texture<class_Texture>` | :ref:`texture_hover<class_TextureButton_property_texture_hover>` | |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`Texture<class_Texture>` | :ref:`texture_normal<class_TextureButton_property_texture_normal>` | |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
| :ref:`Texture<class_Texture>` | :ref:`texture_pressed<class_TextureButton_property_texture_pressed>` | |
|
|
+----------------------------------------------------+----------------------------------------------------------------------------+-----------+
|
|
|
|
Enumeraciones
|
|
--------------------------
|
|
|
|
.. _enum_TextureButton_StretchMode:
|
|
|
|
.. _class_TextureButton_constant_STRETCH_SCALE:
|
|
|
|
.. _class_TextureButton_constant_STRETCH_TILE:
|
|
|
|
.. _class_TextureButton_constant_STRETCH_KEEP:
|
|
|
|
.. _class_TextureButton_constant_STRETCH_KEEP_CENTERED:
|
|
|
|
.. _class_TextureButton_constant_STRETCH_KEEP_ASPECT:
|
|
|
|
.. _class_TextureButton_constant_STRETCH_KEEP_ASPECT_CENTERED:
|
|
|
|
.. _class_TextureButton_constant_STRETCH_KEEP_ASPECT_COVERED:
|
|
|
|
enum **StretchMode**:
|
|
|
|
- **STRETCH_SCALE** = **0** --- Escala para ajustarse al rectángulo delimitador del nodo.
|
|
|
|
- **STRETCH_TILE** = **1** --- Tile dentro del rectángulo delimitador del nodo.
|
|
|
|
- **STRETCH_KEEP** = **2** --- La textura mantiene su tamaño original y se mantiene en la esquina superior izquierda del rectángulo delimitador.
|
|
|
|
- **STRETCH_KEEP_CENTERED** = **3** --- La textura mantiene su tamaño original y permanece centrado en el rectángulo delimitador del nodo.
|
|
|
|
- **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.
|
|
|
|
- **STRETCH_KEEP_ASPECT_CENTERED** = **5** --- Escala la textura para que se ajuste al rectángulo delimitador del nodo, céntrelo y mantenga su relación de aspecto.
|
|
|
|
- **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.
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_TextureButton_property_expand:
|
|
|
|
- :ref:`bool<class_bool>` **expand**
|
|
|
|
+-----------+-------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-------------------+
|
|
| *Setter* | set_expand(value) |
|
|
+-----------+-------------------+
|
|
| *Getter* | get_expand() |
|
|
+-----------+-------------------+
|
|
|
|
Si ``true``, la textura se extiende hasta los bordes del rectángulo delimitador del nodo utilizando el :ref:`stretch_mode<class_TextureButton_property_stretch_mode>`. Si ``false``, la textura no escalará con el nodo.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_flip_h:
|
|
|
|
- :ref:`bool<class_bool>` **flip_h**
|
|
|
|
+-----------+-------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-------------------+
|
|
| *Setter* | set_flip_h(value) |
|
|
+-----------+-------------------+
|
|
| *Getter* | is_flipped_h() |
|
|
+-----------+-------------------+
|
|
|
|
Si ``true``, la textura se voltea horizontalmente.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_flip_v:
|
|
|
|
- :ref:`bool<class_bool>` **flip_v**
|
|
|
|
+-----------+-------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-------------------+
|
|
| *Setter* | set_flip_v(value) |
|
|
+-----------+-------------------+
|
|
| *Getter* | is_flipped_v() |
|
|
+-----------+-------------------+
|
|
|
|
Si ``true``, la textura se voltea verticalmente.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_stretch_mode:
|
|
|
|
- :ref:`StretchMode<enum_TextureButton_StretchMode>` **stretch_mode**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_stretch_mode(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | get_stretch_mode() |
|
|
+-----------+-------------------------+
|
|
|
|
Controla el comportamiento de la textura al redimensionar el rectángulo delimitador del nodo, **sólo si ** :ref:`expand<class_TextureButton_property_expand>` es ``true``. Ponlo en una de las constantes de :ref:`StretchMode<enum_TextureButton_StretchMode>`. Vea las constantes para obtener más información.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_texture_click_mask:
|
|
|
|
- :ref:`BitMap<class_BitMap>` **texture_click_mask**
|
|
|
|
+----------+-----------------------+
|
|
| *Setter* | set_click_mask(value) |
|
|
+----------+-----------------------+
|
|
| *Getter* | get_click_mask() |
|
|
+----------+-----------------------+
|
|
|
|
Imagen en blanco y negro puro :ref:`BitMap<class_BitMap>` para usar en la detección de clics. En la máscara, los píxeles blancos representan el área donde se puede hacer clic en el botón. Úsalo para crear botones con formas curvas.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_texture_disabled:
|
|
|
|
- :ref:`Texture<class_Texture>` **texture_disabled**
|
|
|
|
+----------+-----------------------------+
|
|
| *Setter* | set_disabled_texture(value) |
|
|
+----------+-----------------------------+
|
|
| *Getter* | get_disabled_texture() |
|
|
+----------+-----------------------------+
|
|
|
|
La textura se muestra cuando el nodo está desactivado. Ver :ref:`BaseButton.disabled<class_BaseButton_property_disabled>`.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_texture_focused:
|
|
|
|
- :ref:`Texture<class_Texture>` **texture_focused**
|
|
|
|
+----------+----------------------------+
|
|
| *Setter* | set_focused_texture(value) |
|
|
+----------+----------------------------+
|
|
| *Getter* | get_focused_texture() |
|
|
+----------+----------------------------+
|
|
|
|
La textura se muestra cuando el nodo tiene el foco del ratón o del teclado.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_texture_hover:
|
|
|
|
- :ref:`Texture<class_Texture>` **texture_hover**
|
|
|
|
+----------+--------------------------+
|
|
| *Setter* | set_hover_texture(value) |
|
|
+----------+--------------------------+
|
|
| *Getter* | get_hover_texture() |
|
|
+----------+--------------------------+
|
|
|
|
Textura para mostrar cuando el ratón pasa por encima del nodo.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_texture_normal:
|
|
|
|
- :ref:`Texture<class_Texture>` **texture_normal**
|
|
|
|
+----------+---------------------------+
|
|
| *Setter* | set_normal_texture(value) |
|
|
+----------+---------------------------+
|
|
| *Getter* | get_normal_texture() |
|
|
+----------+---------------------------+
|
|
|
|
Textura a mostrar por defecto, cuando el nodo está **no** en el estado de desactivado, enfocado, cursor encima o pulsado.
|
|
|
|
----
|
|
|
|
.. _class_TextureButton_property_texture_pressed:
|
|
|
|
- :ref:`Texture<class_Texture>` **texture_pressed**
|
|
|
|
+----------+----------------------------+
|
|
| *Setter* | set_pressed_texture(value) |
|
|
+----------+----------------------------+
|
|
| *Getter* | get_pressed_texture() |
|
|
+----------+----------------------------+
|
|
|
|
Textura que se muestra al pasar el ratón por encima del nodo, si el nodo tiene el foco del teclado y el jugador pulsa la tecla Intro o si el jugador pulsa la tecla :ref:`BaseButton.shortcut<class_BaseButton_property_shortcut>`.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|