class_parallaxlayer.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/ParallaxLayer.xml.
  6. .. _class_ParallaxLayer:
  7. ParallaxLayer
  8. =============
  9. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A parallax scrolling layer to be used with :ref:`ParallaxBackground<class_ParallaxBackground>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. This node's children will be affected by its scroll offset.
  16. \ **Note:** Any changes to this node's position and scale made after it enters the scene will be ignored.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-------------------------------+------------------------------------------------------------------------+-------------------+
  23. | :ref:`Vector2<class_Vector2>` | :ref:`motion_mirroring<class_ParallaxLayer_property_motion_mirroring>` | ``Vector2(0, 0)`` |
  24. +-------------------------------+------------------------------------------------------------------------+-------------------+
  25. | :ref:`Vector2<class_Vector2>` | :ref:`motion_offset<class_ParallaxLayer_property_motion_offset>` | ``Vector2(0, 0)`` |
  26. +-------------------------------+------------------------------------------------------------------------+-------------------+
  27. | :ref:`Vector2<class_Vector2>` | :ref:`motion_scale<class_ParallaxLayer_property_motion_scale>` | ``Vector2(1, 1)`` |
  28. +-------------------------------+------------------------------------------------------------------------+-------------------+
  29. .. rst-class:: classref-section-separator
  30. ----
  31. .. rst-class:: classref-descriptions-group
  32. Property Descriptions
  33. ---------------------
  34. .. _class_ParallaxLayer_property_motion_mirroring:
  35. .. rst-class:: classref-property
  36. :ref:`Vector2<class_Vector2>` **motion_mirroring** = ``Vector2(0, 0)``
  37. .. rst-class:: classref-property-setget
  38. - void **set_mirroring** **(** :ref:`Vector2<class_Vector2>` value **)**
  39. - :ref:`Vector2<class_Vector2>` **get_mirroring** **(** **)**
  40. The ParallaxLayer's :ref:`Texture2D<class_Texture2D>` repeating. Useful for creating an infinite scrolling background. If an axis is set to ``0``, the :ref:`Texture2D<class_Texture2D>` will not be repeated.
  41. If the length of the viewport axis is bigger than twice the repeated axis size, it will not repeat infinitely, as the parallax layer only draws 2 instances of the texture at any given time.
  42. \ **Note:** Despite its name, the texture will not be mirrored, it will simply be repeated.
  43. .. rst-class:: classref-item-separator
  44. ----
  45. .. _class_ParallaxLayer_property_motion_offset:
  46. .. rst-class:: classref-property
  47. :ref:`Vector2<class_Vector2>` **motion_offset** = ``Vector2(0, 0)``
  48. .. rst-class:: classref-property-setget
  49. - void **set_motion_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  50. - :ref:`Vector2<class_Vector2>` **get_motion_offset** **(** **)**
  51. The ParallaxLayer's offset relative to the parent ParallaxBackground's :ref:`ParallaxBackground.scroll_offset<class_ParallaxBackground_property_scroll_offset>`.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_ParallaxLayer_property_motion_scale:
  55. .. rst-class:: classref-property
  56. :ref:`Vector2<class_Vector2>` **motion_scale** = ``Vector2(1, 1)``
  57. .. rst-class:: classref-property-setget
  58. - void **set_motion_scale** **(** :ref:`Vector2<class_Vector2>` value **)**
  59. - :ref:`Vector2<class_Vector2>` **get_motion_scale** **(** **)**
  60. Multiplies the ParallaxLayer's motion. If an axis is set to ``0``, it will not scroll.
  61. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  62. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  63. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  64. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  65. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  66. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`