class_parallaxbackground.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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>` | Vector2( 0, 0 ) |
  17. +-------------------------------+-----------------------------------------------------------------------------------------------+-----------------+
  18. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_scale<class_ParallaxBackground_property_scroll_base_scale>` | Vector2( 1, 1 ) |
  19. +-------------------------------+-----------------------------------------------------------------------------------------------+-----------------+
  20. | :ref:`bool<class_bool>` | :ref:`scroll_ignore_camera_zoom<class_ParallaxBackground_property_scroll_ignore_camera_zoom>` | false |
  21. +-------------------------------+-----------------------------------------------------------------------------------------------+-----------------+
  22. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_begin<class_ParallaxBackground_property_scroll_limit_begin>` | Vector2( 0, 0 ) |
  23. +-------------------------------+-----------------------------------------------------------------------------------------------+-----------------+
  24. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_end<class_ParallaxBackground_property_scroll_limit_end>` | Vector2( 0, 0 ) |
  25. +-------------------------------+-----------------------------------------------------------------------------------------------+-----------------+
  26. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_offset<class_ParallaxBackground_property_scroll_offset>` | Vector2( 0, 0 ) |
  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. | *Default* | Vector2( 0, 0 ) |
  37. +-----------+-------------------------------+
  38. | *Setter* | set_scroll_base_offset(value) |
  39. +-----------+-------------------------------+
  40. | *Getter* | get_scroll_base_offset() |
  41. +-----------+-------------------------------+
  42. The base position offset for all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
  43. .. _class_ParallaxBackground_property_scroll_base_scale:
  44. - :ref:`Vector2<class_Vector2>` **scroll_base_scale**
  45. +-----------+------------------------------+
  46. | *Default* | Vector2( 1, 1 ) |
  47. +-----------+------------------------------+
  48. | *Setter* | set_scroll_base_scale(value) |
  49. +-----------+------------------------------+
  50. | *Getter* | get_scroll_base_scale() |
  51. +-----------+------------------------------+
  52. The base motion scale for all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
  53. .. _class_ParallaxBackground_property_scroll_ignore_camera_zoom:
  54. - :ref:`bool<class_bool>` **scroll_ignore_camera_zoom**
  55. +-----------+-------------------------------+
  56. | *Default* | false |
  57. +-----------+-------------------------------+
  58. | *Setter* | set_ignore_camera_zoom(value) |
  59. +-----------+-------------------------------+
  60. | *Getter* | is_ignore_camera_zoom() |
  61. +-----------+-------------------------------+
  62. If ``true``, elements in :ref:`ParallaxLayer<class_ParallaxLayer>` child aren't affected by the zoom level of the camera.
  63. .. _class_ParallaxBackground_property_scroll_limit_begin:
  64. - :ref:`Vector2<class_Vector2>` **scroll_limit_begin**
  65. +-----------+------------------------+
  66. | *Default* | Vector2( 0, 0 ) |
  67. +-----------+------------------------+
  68. | *Setter* | set_limit_begin(value) |
  69. +-----------+------------------------+
  70. | *Getter* | get_limit_begin() |
  71. +-----------+------------------------+
  72. 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.
  73. .. _class_ParallaxBackground_property_scroll_limit_end:
  74. - :ref:`Vector2<class_Vector2>` **scroll_limit_end**
  75. +-----------+----------------------+
  76. | *Default* | Vector2( 0, 0 ) |
  77. +-----------+----------------------+
  78. | *Setter* | set_limit_end(value) |
  79. +-----------+----------------------+
  80. | *Getter* | get_limit_end() |
  81. +-----------+----------------------+
  82. Bottom-right 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.
  83. .. _class_ParallaxBackground_property_scroll_offset:
  84. - :ref:`Vector2<class_Vector2>` **scroll_offset**
  85. +-----------+--------------------------+
  86. | *Default* | Vector2( 0, 0 ) |
  87. +-----------+--------------------------+
  88. | *Setter* | set_scroll_offset(value) |
  89. +-----------+--------------------------+
  90. | *Getter* | get_scroll_offset() |
  91. +-----------+--------------------------+
  92. 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.