virtualx-engine-docs/_sources/classes/class_parallaxlayer.rst.txt
2024-10-23 09:41:33 -07:00

107 lines
5.5 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ParallaxLayer.xml.
.. _class_ParallaxLayer:
ParallaxLayer
=============
**Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
A parallax scrolling layer to be used with :ref:`ParallaxBackground<class_ParallaxBackground>`.
.. rst-class:: classref-introduction-group
Description
-----------
A ParallaxLayer must be the child of a :ref:`ParallaxBackground<class_ParallaxBackground>` node. Each ParallaxLayer can be set to move at different speeds relative to the camera movement or the :ref:`ParallaxBackground.scroll_offset<class_ParallaxBackground_property_scroll_offset>` value.
This node's children will be affected by its scroll offset.
\ **Note:** Any changes to this node's position and scale made after it enters the scene will be ignored.
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+---------------------------------------------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`motion_mirroring<class_ParallaxLayer_property_motion_mirroring>` | ``Vector2( 0, 0 )`` |
+---------------------------------------------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`motion_offset<class_ParallaxLayer_property_motion_offset>` | ``Vector2( 0, 0 )`` |
+---------------------------------------------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`motion_scale<class_ParallaxLayer_property_motion_scale>` | ``Vector2( 1, 1 )`` |
+---------------------------------------------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------------------------+
| :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` | physics_interpolation_mode | ``1`` (overrides :ref:`Node<class_Node_property_physics_interpolation_mode>`) |
+---------------------------------------------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ParallaxLayer_property_motion_mirroring:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **motion_mirroring** = ``Vector2( 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_mirroring** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_mirroring** **(** **)**
The ParallaxLayer's :ref:`Texture<class_Texture>` mirroring. Useful for creating an infinite scrolling background. If an axis is set to ``0``, the :ref:`Texture<class_Texture>` will not be mirrored.
If the length of the viewport axis is bigger than twice the mirrored axis size, it will not repeat infinitely, as the parallax layer only draws 2 instances of the texture at any one time.
.. rst-class:: classref-item-separator
----
.. _class_ParallaxLayer_property_motion_offset:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **motion_offset** = ``Vector2( 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_motion_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_motion_offset** **(** **)**
The ParallaxLayer's offset relative to the parent ParallaxBackground's :ref:`ParallaxBackground.scroll_offset<class_ParallaxBackground_property_scroll_offset>`.
.. rst-class:: classref-item-separator
----
.. _class_ParallaxLayer_property_motion_scale:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **motion_scale** = ``Vector2( 1, 1 )``
.. rst-class:: classref-property-setget
- void **set_motion_scale** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_motion_scale** **(** **)**
Multiplies the ParallaxLayer's motion. If an axis is set to ``0``, it will not scroll.
.. |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.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`