class_parallaxlayer.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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. Description
  12. -----------
  13. 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.
  14. This node's children will be affected by its scroll offset.
  15. \ **Note:** Any changes to this node's position and scale made after it enters the scene will be ignored.
  16. Properties
  17. ----------
  18. +-------------------------------+------------------------------------------------------------------------+-------------------+
  19. | :ref:`Vector2<class_Vector2>` | :ref:`motion_mirroring<class_ParallaxLayer_property_motion_mirroring>` | ``Vector2(0, 0)`` |
  20. +-------------------------------+------------------------------------------------------------------------+-------------------+
  21. | :ref:`Vector2<class_Vector2>` | :ref:`motion_offset<class_ParallaxLayer_property_motion_offset>` | ``Vector2(0, 0)`` |
  22. +-------------------------------+------------------------------------------------------------------------+-------------------+
  23. | :ref:`Vector2<class_Vector2>` | :ref:`motion_scale<class_ParallaxLayer_property_motion_scale>` | ``Vector2(1, 1)`` |
  24. +-------------------------------+------------------------------------------------------------------------+-------------------+
  25. Property Descriptions
  26. ---------------------
  27. .. _class_ParallaxLayer_property_motion_mirroring:
  28. - :ref:`Vector2<class_Vector2>` **motion_mirroring**
  29. +-----------+----------------------+
  30. | *Default* | ``Vector2(0, 0)`` |
  31. +-----------+----------------------+
  32. | *Setter* | set_mirroring(value) |
  33. +-----------+----------------------+
  34. | *Getter* | get_mirroring() |
  35. +-----------+----------------------+
  36. 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.
  37. 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.
  38. ----
  39. .. _class_ParallaxLayer_property_motion_offset:
  40. - :ref:`Vector2<class_Vector2>` **motion_offset**
  41. +-----------+--------------------------+
  42. | *Default* | ``Vector2(0, 0)`` |
  43. +-----------+--------------------------+
  44. | *Setter* | set_motion_offset(value) |
  45. +-----------+--------------------------+
  46. | *Getter* | get_motion_offset() |
  47. +-----------+--------------------------+
  48. The ParallaxLayer's offset relative to the parent ParallaxBackground's :ref:`ParallaxBackground.scroll_offset<class_ParallaxBackground_property_scroll_offset>`.
  49. ----
  50. .. _class_ParallaxLayer_property_motion_scale:
  51. - :ref:`Vector2<class_Vector2>` **motion_scale**
  52. +-----------+-------------------------+
  53. | *Default* | ``Vector2(1, 1)`` |
  54. +-----------+-------------------------+
  55. | *Setter* | set_motion_scale(value) |
  56. +-----------+-------------------------+
  57. | *Getter* | get_motion_scale() |
  58. +-----------+-------------------------+
  59. Multiplies the ParallaxLayer's motion. If an axis is set to ``0``, it will not scroll.
  60. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  61. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  62. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  63. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  64. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  65. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`