class_parallaxlayer.rst 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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:`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.
  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.)`