class_parallaxlayer.rst 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.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. **Category:** Core
  10. Brief Description
  11. -----------------
  12. A parallax scrolling layer to be used with :ref:`ParallaxBackground<class_ParallaxBackground>`.
  13. Properties
  14. ----------
  15. +-------------------------------+------------------------------------------------------------------------+-----------------+
  16. | :ref:`Vector2<class_Vector2>` | :ref:`motion_mirroring<class_ParallaxLayer_property_motion_mirroring>` | Vector2( 0, 0 ) |
  17. +-------------------------------+------------------------------------------------------------------------+-----------------+
  18. | :ref:`Vector2<class_Vector2>` | :ref:`motion_offset<class_ParallaxLayer_property_motion_offset>` | Vector2( 0, 0 ) |
  19. +-------------------------------+------------------------------------------------------------------------+-----------------+
  20. | :ref:`Vector2<class_Vector2>` | :ref:`motion_scale<class_ParallaxLayer_property_motion_scale>` | Vector2( 1, 1 ) |
  21. +-------------------------------+------------------------------------------------------------------------+-----------------+
  22. Description
  23. -----------
  24. 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.
  25. This node's children will be affected by its scroll offset.
  26. **Note:** Any changes to this node's position and scale made after it enters the scene will be ignored.
  27. Property Descriptions
  28. ---------------------
  29. .. _class_ParallaxLayer_property_motion_mirroring:
  30. - :ref:`Vector2<class_Vector2>` **motion_mirroring**
  31. +-----------+----------------------+
  32. | *Default* | Vector2( 0, 0 ) |
  33. +-----------+----------------------+
  34. | *Setter* | set_mirroring(value) |
  35. +-----------+----------------------+
  36. | *Getter* | get_mirroring() |
  37. +-----------+----------------------+
  38. 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.
  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. .. _class_ParallaxLayer_property_motion_scale:
  50. - :ref:`Vector2<class_Vector2>` **motion_scale**
  51. +-----------+-------------------------+
  52. | *Default* | Vector2( 1, 1 ) |
  53. +-----------+-------------------------+
  54. | *Setter* | set_motion_scale(value) |
  55. +-----------+-------------------------+
  56. | *Getter* | get_motion_scale() |
  57. +-----------+-------------------------+
  58. Multiplies the ParallaxLayer's motion. If an axis is set to ``0``, it will not scroll.