class_parallaxlayer.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ParallaxLayer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ParallaxLayer:
  6. ParallaxLayer
  7. =============
  8. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. A parallax scrolling layer to be used with :ref:`ParallaxBackground<class_ParallaxBackground>`.
  10. Description
  11. -----------
  12. 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.
  13. This node's children will be affected by its scroll offset.
  14. \ **Note:** Any changes to this node's position and scale made after it enters the scene will be ignored.
  15. Properties
  16. ----------
  17. +-------------------------------+------------------------------------------------------------------------+-------------------+
  18. | :ref:`Vector2<class_Vector2>` | :ref:`motion_mirroring<class_ParallaxLayer_property_motion_mirroring>` | ``Vector2(0, 0)`` |
  19. +-------------------------------+------------------------------------------------------------------------+-------------------+
  20. | :ref:`Vector2<class_Vector2>` | :ref:`motion_offset<class_ParallaxLayer_property_motion_offset>` | ``Vector2(0, 0)`` |
  21. +-------------------------------+------------------------------------------------------------------------+-------------------+
  22. | :ref:`Vector2<class_Vector2>` | :ref:`motion_scale<class_ParallaxLayer_property_motion_scale>` | ``Vector2(1, 1)`` |
  23. +-------------------------------+------------------------------------------------------------------------+-------------------+
  24. Property Descriptions
  25. ---------------------
  26. .. _class_ParallaxLayer_property_motion_mirroring:
  27. - :ref:`Vector2<class_Vector2>` **motion_mirroring**
  28. +-----------+----------------------+
  29. | *Default* | ``Vector2(0, 0)`` |
  30. +-----------+----------------------+
  31. | *Setter* | set_mirroring(value) |
  32. +-----------+----------------------+
  33. | *Getter* | get_mirroring() |
  34. +-----------+----------------------+
  35. The ParallaxLayer's :ref:`Texture2D<class_Texture2D>` mirroring. Useful for creating an infinite scrolling background. If an axis is set to ``0``, the :ref:`Texture2D<class_Texture2D>` will not be mirrored.
  36. ----
  37. .. _class_ParallaxLayer_property_motion_offset:
  38. - :ref:`Vector2<class_Vector2>` **motion_offset**
  39. +-----------+--------------------------+
  40. | *Default* | ``Vector2(0, 0)`` |
  41. +-----------+--------------------------+
  42. | *Setter* | set_motion_offset(value) |
  43. +-----------+--------------------------+
  44. | *Getter* | get_motion_offset() |
  45. +-----------+--------------------------+
  46. The ParallaxLayer's offset relative to the parent ParallaxBackground's :ref:`ParallaxBackground.scroll_offset<class_ParallaxBackground_property_scroll_offset>`.
  47. ----
  48. .. _class_ParallaxLayer_property_motion_scale:
  49. - :ref:`Vector2<class_Vector2>` **motion_scale**
  50. +-----------+-------------------------+
  51. | *Default* | ``Vector2(1, 1)`` |
  52. +-----------+-------------------------+
  53. | *Setter* | set_motion_scale(value) |
  54. +-----------+-------------------------+
  55. | *Getter* | get_motion_scale() |
  56. +-----------+-------------------------+
  57. Multiplies the ParallaxLayer's motion. If an axis is set to ``0``, it will not scroll.
  58. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  59. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  60. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  61. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  62. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  63. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`