class_parallaxbackground.rst 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the ParallaxBackground.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_ParallaxBackground:
  5. ParallaxBackground
  6. ==================
  7. **Inherits:** :ref:`CanvasLayer<class_canvaslayer>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. A node used to create a parallax scrolling background.
  12. Member Variables
  13. ----------------
  14. .. _class_ParallaxBackground_scroll_base_offset:
  15. - :ref:`Vector2<class_vector2>` **scroll_base_offset** - Base position offset of all :ref:`ParallaxLayer<class_parallaxlayer>` children.
  16. .. _class_ParallaxBackground_scroll_base_scale:
  17. - :ref:`Vector2<class_vector2>` **scroll_base_scale** - Base motion scale of all :ref:`ParallaxLayer<class_parallaxlayer>` children.
  18. .. _class_ParallaxBackground_scroll_ignore_camera_zoom:
  19. - :ref:`bool<class_bool>` **scroll_ignore_camera_zoom** - If ``true`` elements in :ref:`ParallaxLayer<class_parallaxlayer>` child aren't affected by the zoom level of the camera.
  20. .. _class_ParallaxBackground_scroll_limit_begin:
  21. - :ref:`Vector2<class_vector2>` **scroll_limit_begin** - Top left limits for scrolling to begin. If the camera is outside of this limit the background will stop scrolling. Must be lower than :ref:`scroll_limit_end<class_ParallaxBackground_scroll_limit_end>` to work.
  22. .. _class_ParallaxBackground_scroll_limit_end:
  23. - :ref:`Vector2<class_vector2>` **scroll_limit_end** - Right bottom limits for scrolling to end. If the camera is outside of this limit the background will stop scrolling. Must be higher than :ref:`scroll_limit_begin<class_ParallaxBackground_scroll_limit_begin>` to work.
  24. .. _class_ParallaxBackground_scroll_offset:
  25. - :ref:`Vector2<class_vector2>` **scroll_offset** - The ParallaxBackground's scroll value. Calculated automatically when using a :ref:`Camera2D<class_camera2d>`, but can be used to manually manage scrolling when no camera is present.
  26. Description
  27. -----------
  28. A ParallaxBackground uses one or more :ref:`ParallaxLayer<class_parallaxlayer>` child nodes to create a parallax effect. Each :ref:`ParallaxLayer<class_parallaxlayer>` can move at a different speed using :ref:`ParallaxLayer.motion_offset<class_ParallaxLayer_motion_offset>`. This creates an illusion of depth in a 2D game. If not used with a :ref:`Camera2D<class_camera2d>`, you must manually calculate the :ref:`scroll_offset<class_ParallaxBackground_scroll_offset>`.