Files
godot-docs-l10n/classes/es/class_pathfollow2d.rst

184 lines
8.2 KiB
ReStructuredText

:github_url: hide
.. _class_PathFollow2D:
PathFollow2D
============
**Hereda:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Una muestra de puntos para un :ref:`Path2D<class_Path2D>`.
.. rst-class:: classref-introduction-group
Descripción
----------------------
This node takes its parent :ref:`Path2D<class_Path2D>`, and returns the coordinates of a point within it, given a distance from the first vertex.
It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting the :ref:`progress<class_PathFollow2D_property_progress>` in this node.
.. rst-class:: classref-reftable-group
Propiedades
----------------------
.. table::
:widths: auto
+---------------------------+-------------------------------------------------------------------+----------+
| :ref:`bool<class_bool>` | :ref:`cubic_interp<class_PathFollow2D_property_cubic_interp>` | ``true`` |
+---------------------------+-------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`h_offset<class_PathFollow2D_property_h_offset>` | ``0.0`` |
+---------------------------+-------------------------------------------------------------------+----------+
| :ref:`bool<class_bool>` | :ref:`loop<class_PathFollow2D_property_loop>` | ``true`` |
+---------------------------+-------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`progress<class_PathFollow2D_property_progress>` | ``0.0`` |
+---------------------------+-------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`progress_ratio<class_PathFollow2D_property_progress_ratio>` | ``0.0`` |
+---------------------------+-------------------------------------------------------------------+----------+
| :ref:`bool<class_bool>` | :ref:`rotates<class_PathFollow2D_property_rotates>` | ``true`` |
+---------------------------+-------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`v_offset<class_PathFollow2D_property_v_offset>` | ``0.0`` |
+---------------------------+-------------------------------------------------------------------+----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Descripciones de Propiedades
--------------------------------------------------------
.. _class_PathFollow2D_property_cubic_interp:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **cubic_interp** = ``true`` :ref:`🔗<class_PathFollow2D_property_cubic_interp>`
.. rst-class:: classref-property-setget
- |void| **set_cubic_interpolation**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **get_cubic_interpolation**\ (\ )
Si es ``true``, la posición entre dos puntos cacheados se interpola cúbicamente, y linealmente en caso contrario.
Los puntos a lo largo de la :ref:`Curve2D<class_Curve2D>` del :ref:`Path2D<class_Path2D>` se precalculan antes de su uso, para cálculos más rápidos. El punto en el desplazamiento solicitado se calcula entonces interpolando entre dos puntos cacheados adyacentes. Esto puede presentar un problema si la curva hace giros bruscos, ya que los puntos cacheados pueden no seguir la curva lo suficientemente cerca.
Hay dos respuestas a este problema: o bien aumentar el número de puntos cacheados y aumentar el consumo de memoria, o bien hacer una interpolación cúbica entre dos puntos a costa de cálculos (ligeramente) más lentos.
.. rst-class:: classref-item-separator
----
.. _class_PathFollow2D_property_h_offset:
.. rst-class:: classref-property
:ref:`float<class_float>` **h_offset** = ``0.0`` :ref:`🔗<class_PathFollow2D_property_h_offset>`
.. rst-class:: classref-property-setget
- |void| **set_h_offset**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_h_offset**\ (\ )
El nodo está desplazado a lo largo de la curva.
.. rst-class:: classref-item-separator
----
.. _class_PathFollow2D_property_loop:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **loop** = ``true`` :ref:`🔗<class_PathFollow2D_property_loop>`
.. rst-class:: classref-property-setget
- |void| **set_loop**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **has_loop**\ (\ )
Si es ``true``, cualquier desplazamiento fuera de la longitud del camino se envolverá, en lugar de detenerse en los extremos. Úsalo para los caminos cíclicos.
.. rst-class:: classref-item-separator
----
.. _class_PathFollow2D_property_progress:
.. rst-class:: classref-property
:ref:`float<class_float>` **progress** = ``0.0`` :ref:`🔗<class_PathFollow2D_property_progress>`
.. rst-class:: classref-property-setget
- |void| **set_progress**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_progress**\ (\ )
La distancia a lo largo de la ruta, en píxeles. Al cambiar este valor, la posición de este nodo se establece en un punto dentro de la ruta.
.. rst-class:: classref-item-separator
----
.. _class_PathFollow2D_property_progress_ratio:
.. rst-class:: classref-property
:ref:`float<class_float>` **progress_ratio** = ``0.0`` :ref:`🔗<class_PathFollow2D_property_progress_ratio>`
.. rst-class:: classref-property-setget
- |void| **set_progress_ratio**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_progress_ratio**\ (\ )
The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). This is just another way of expressing the progress within the path, as the offset supplied is multiplied internally by the path's length.
It can be set or get only if the **PathFollow2D** is the child of a :ref:`Path2D<class_Path2D>` which is part of the scene tree, and that this :ref:`Path2D<class_Path2D>` has a :ref:`Curve2D<class_Curve2D>` with a non-zero length. Otherwise, trying to set this field will print an error, and getting this field will return ``0.0``.
.. rst-class:: classref-item-separator
----
.. _class_PathFollow2D_property_rotates:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **rotates** = ``true`` :ref:`🔗<class_PathFollow2D_property_rotates>`
.. rst-class:: classref-property-setget
- |void| **set_rotates**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_rotating**\ (\ )
If ``true``, this node rotates to follow the path, with the +X direction facing forward on the path.
.. rst-class:: classref-item-separator
----
.. _class_PathFollow2D_property_v_offset:
.. rst-class:: classref-property
:ref:`float<class_float>` **v_offset** = ``0.0`` :ref:`🔗<class_PathFollow2D_property_v_offset>`
.. rst-class:: classref-property-setget
- |void| **set_v_offset**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_v_offset**\ (\ )
El nodo está desplazado perpendicularmente a la curva.
.. |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.)`