class_parallaxbackground.rst 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 ParallaxBackground.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ParallaxBackground:
  6. ParallaxBackground
  7. ==================
  8. **Inherits:** :ref:`CanvasLayer<class_CanvasLayer>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. A node used to create a parallax scrolling background.
  13. Properties
  14. ----------
  15. +-------------------------------+-----------------------------------------------------------------------------------------------+
  16. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_offset<class_ParallaxBackground_property_scroll_base_offset>` |
  17. +-------------------------------+-----------------------------------------------------------------------------------------------+
  18. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_scale<class_ParallaxBackground_property_scroll_base_scale>` |
  19. +-------------------------------+-----------------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`scroll_ignore_camera_zoom<class_ParallaxBackground_property_scroll_ignore_camera_zoom>` |
  21. +-------------------------------+-----------------------------------------------------------------------------------------------+
  22. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_begin<class_ParallaxBackground_property_scroll_limit_begin>` |
  23. +-------------------------------+-----------------------------------------------------------------------------------------------+
  24. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_end<class_ParallaxBackground_property_scroll_limit_end>` |
  25. +-------------------------------+-----------------------------------------------------------------------------------------------+
  26. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_offset<class_ParallaxBackground_property_scroll_offset>` |
  27. +-------------------------------+-----------------------------------------------------------------------------------------------+
  28. Description
  29. -----------
  30. 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_property_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_property_scroll_offset>`.
  31. Property Descriptions
  32. ---------------------
  33. .. _class_ParallaxBackground_property_scroll_base_offset:
  34. - :ref:`Vector2<class_Vector2>` **scroll_base_offset**
  35. +----------+-------------------------------+
  36. | *Setter* | set_scroll_base_offset(value) |
  37. +----------+-------------------------------+
  38. | *Getter* | get_scroll_base_offset() |
  39. +----------+-------------------------------+
  40. Base position offset of all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
  41. ----
  42. .. _class_ParallaxBackground_property_scroll_base_scale:
  43. - :ref:`Vector2<class_Vector2>` **scroll_base_scale**
  44. +----------+------------------------------+
  45. | *Setter* | set_scroll_base_scale(value) |
  46. +----------+------------------------------+
  47. | *Getter* | get_scroll_base_scale() |
  48. +----------+------------------------------+
  49. Base motion scale of all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
  50. ----
  51. .. _class_ParallaxBackground_property_scroll_ignore_camera_zoom:
  52. - :ref:`bool<class_bool>` **scroll_ignore_camera_zoom**
  53. +----------+-------------------------------+
  54. | *Setter* | set_ignore_camera_zoom(value) |
  55. +----------+-------------------------------+
  56. | *Getter* | is_ignore_camera_zoom() |
  57. +----------+-------------------------------+
  58. If ``true``, elements in :ref:`ParallaxLayer<class_ParallaxLayer>` child aren't affected by the zoom level of the camera.
  59. ----
  60. .. _class_ParallaxBackground_property_scroll_limit_begin:
  61. - :ref:`Vector2<class_Vector2>` **scroll_limit_begin**
  62. +----------+------------------------+
  63. | *Setter* | set_limit_begin(value) |
  64. +----------+------------------------+
  65. | *Getter* | get_limit_begin() |
  66. +----------+------------------------+
  67. 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_property_scroll_limit_end>` to work.
  68. ----
  69. .. _class_ParallaxBackground_property_scroll_limit_end:
  70. - :ref:`Vector2<class_Vector2>` **scroll_limit_end**
  71. +----------+----------------------+
  72. | *Setter* | set_limit_end(value) |
  73. +----------+----------------------+
  74. | *Getter* | get_limit_end() |
  75. +----------+----------------------+
  76. 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_property_scroll_limit_begin>` to work.
  77. ----
  78. .. _class_ParallaxBackground_property_scroll_offset:
  79. - :ref:`Vector2<class_Vector2>` **scroll_offset**
  80. +----------+--------------------------+
  81. | *Setter* | set_scroll_offset(value) |
  82. +----------+--------------------------+
  83. | *Getter* | get_scroll_offset() |
  84. +----------+--------------------------+
  85. 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.