class_parallaxlayer.rst 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/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. | :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` | physics_interpolation_mode | ``1`` (overrides :ref:`Node<class_Node_property_physics_interpolation_mode>`) |
  30. +---------------------------------------------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  31. .. rst-class:: classref-section-separator
  32. ----
  33. .. rst-class:: classref-descriptions-group
  34. Property Descriptions
  35. ---------------------
  36. .. _class_ParallaxLayer_property_motion_mirroring:
  37. .. rst-class:: classref-property
  38. :ref:`Vector2<class_Vector2>` **motion_mirroring** = ``Vector2( 0, 0 )``
  39. .. rst-class:: classref-property-setget
  40. - void **set_mirroring** **(** :ref:`Vector2<class_Vector2>` value **)**
  41. - :ref:`Vector2<class_Vector2>` **get_mirroring** **(** **)**
  42. 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.
  43. 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.
  44. .. rst-class:: classref-item-separator
  45. ----
  46. .. _class_ParallaxLayer_property_motion_offset:
  47. .. rst-class:: classref-property
  48. :ref:`Vector2<class_Vector2>` **motion_offset** = ``Vector2( 0, 0 )``
  49. .. rst-class:: classref-property-setget
  50. - void **set_motion_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  51. - :ref:`Vector2<class_Vector2>` **get_motion_offset** **(** **)**
  52. The ParallaxLayer's offset relative to the parent ParallaxBackground's :ref:`ParallaxBackground.scroll_offset<class_ParallaxBackground_property_scroll_offset>`.
  53. .. rst-class:: classref-item-separator
  54. ----
  55. .. _class_ParallaxLayer_property_motion_scale:
  56. .. rst-class:: classref-property
  57. :ref:`Vector2<class_Vector2>` **motion_scale** = ``Vector2( 1, 1 )``
  58. .. rst-class:: classref-property-setget
  59. - void **set_motion_scale** **(** :ref:`Vector2<class_Vector2>` value **)**
  60. - :ref:`Vector2<class_Vector2>` **get_motion_scale** **(** **)**
  61. Multiplies the ParallaxLayer's motion. If an axis is set to ``0``, it will not scroll.
  62. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  63. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  64. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  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.)`