class_parallaxlayer.rst 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the ParallaxLayer.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_ParallaxLayer:
  5. ParallaxLayer
  6. =============
  7. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. A parallax scrolling layer to be used with :ref:`ParallaxBackground<class_parallaxbackground>`.
  12. Member Functions
  13. ----------------
  14. +--------------------------------+------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Vector2<class_vector2>` | :ref:`get_mirroring<class_ParallaxLayer_get_mirroring>` **(** **)** const |
  16. +--------------------------------+------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Vector2<class_vector2>` | :ref:`get_motion_offset<class_ParallaxLayer_get_motion_offset>` **(** **)** const |
  18. +--------------------------------+------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Vector2<class_vector2>` | :ref:`get_motion_scale<class_ParallaxLayer_get_motion_scale>` **(** **)** const |
  20. +--------------------------------+------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`set_mirroring<class_ParallaxLayer_set_mirroring>` **(** :ref:`Vector2<class_vector2>` mirror **)** |
  22. +--------------------------------+------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`set_motion_offset<class_ParallaxLayer_set_motion_offset>` **(** :ref:`Vector2<class_vector2>` offset **)** |
  24. +--------------------------------+------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_motion_scale<class_ParallaxLayer_set_motion_scale>` **(** :ref:`Vector2<class_vector2>` scale **)** |
  26. +--------------------------------+------------------------------------------------------------------------------------------------------------------+
  27. Member Variables
  28. ----------------
  29. .. _class_ParallaxLayer_motion_mirroring:
  30. - :ref:`Vector2<class_vector2>` **motion_mirroring** - 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. Default value: ``(0, 0)``.
  31. .. _class_ParallaxLayer_motion_offset:
  32. - :ref:`Vector2<class_vector2>` **motion_offset** - The ParallaxLayer's offset relative to the parent ParallaxBackground's :ref:`ParallaxBackground.scroll_offset<class_ParallaxBackground_scroll_offset>`.
  33. .. _class_ParallaxLayer_motion_scale:
  34. - :ref:`Vector2<class_vector2>` **motion_scale** - Multiplies the ParallaxLayer's motion. If an axis is set to ``0`` it will not scroll.
  35. Description
  36. -----------
  37. 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_scroll_offset>` value.
  38. This node's children will be affected by its scroll offset.
  39. Member Function Description
  40. ---------------------------
  41. .. _class_ParallaxLayer_get_mirroring:
  42. - :ref:`Vector2<class_vector2>` **get_mirroring** **(** **)** const
  43. Return the mirroring of the ParallaxLayer.
  44. .. _class_ParallaxLayer_get_motion_offset:
  45. - :ref:`Vector2<class_vector2>` **get_motion_offset** **(** **)** const
  46. .. _class_ParallaxLayer_get_motion_scale:
  47. - :ref:`Vector2<class_vector2>` **get_motion_scale** **(** **)** const
  48. Return the motion scale of the ParallaxLayer.
  49. .. _class_ParallaxLayer_set_mirroring:
  50. - void **set_mirroring** **(** :ref:`Vector2<class_vector2>` mirror **)**
  51. Set the mirroring of the ParallaxLayer. If an axis is set to 0 then that axis will have no mirroring.
  52. .. _class_ParallaxLayer_set_motion_offset:
  53. - void **set_motion_offset** **(** :ref:`Vector2<class_vector2>` offset **)**
  54. .. _class_ParallaxLayer_set_motion_scale:
  55. - void **set_motion_scale** **(** :ref:`Vector2<class_vector2>` scale **)**
  56. Set the motion scale of the ParallaxLayer. If an axis is set to 0 then it will not move at all, it will stick with the camera.