class_parallaxbackground.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ParallaxBackground.xml.
  6. .. _class_ParallaxBackground:
  7. ParallaxBackground
  8. ==================
  9. **Inherits:** :ref:`CanvasLayer<class_CanvasLayer>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A node used to create a parallax scrolling background.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +-------------------------------+-----------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | layer | ``-100`` (overrides :ref:`CanvasLayer<class_CanvasLayer_property_layer>`) |
  22. +-------------------------------+-----------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  23. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_offset<class_ParallaxBackground_property_scroll_base_offset>` | ``Vector2( 0, 0 )`` |
  24. +-------------------------------+-----------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  25. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_scale<class_ParallaxBackground_property_scroll_base_scale>` | ``Vector2( 1, 1 )`` |
  26. +-------------------------------+-----------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`scroll_ignore_camera_zoom<class_ParallaxBackground_property_scroll_ignore_camera_zoom>` | ``false`` |
  28. +-------------------------------+-----------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  29. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_begin<class_ParallaxBackground_property_scroll_limit_begin>` | ``Vector2( 0, 0 )`` |
  30. +-------------------------------+-----------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  31. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_end<class_ParallaxBackground_property_scroll_limit_end>` | ``Vector2( 0, 0 )`` |
  32. +-------------------------------+-----------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  33. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_offset<class_ParallaxBackground_property_scroll_offset>` | ``Vector2( 0, 0 )`` |
  34. +-------------------------------+-----------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  35. .. rst-class:: classref-section-separator
  36. ----
  37. .. rst-class:: classref-descriptions-group
  38. Property Descriptions
  39. ---------------------
  40. .. _class_ParallaxBackground_property_scroll_base_offset:
  41. .. rst-class:: classref-property
  42. :ref:`Vector2<class_Vector2>` **scroll_base_offset** = ``Vector2( 0, 0 )``
  43. .. rst-class:: classref-property-setget
  44. - void **set_scroll_base_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  45. - :ref:`Vector2<class_Vector2>` **get_scroll_base_offset** **(** **)**
  46. The base position offset for all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
  47. .. rst-class:: classref-item-separator
  48. ----
  49. .. _class_ParallaxBackground_property_scroll_base_scale:
  50. .. rst-class:: classref-property
  51. :ref:`Vector2<class_Vector2>` **scroll_base_scale** = ``Vector2( 1, 1 )``
  52. .. rst-class:: classref-property-setget
  53. - void **set_scroll_base_scale** **(** :ref:`Vector2<class_Vector2>` value **)**
  54. - :ref:`Vector2<class_Vector2>` **get_scroll_base_scale** **(** **)**
  55. The base motion scale for all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_ParallaxBackground_property_scroll_ignore_camera_zoom:
  59. .. rst-class:: classref-property
  60. :ref:`bool<class_bool>` **scroll_ignore_camera_zoom** = ``false``
  61. .. rst-class:: classref-property-setget
  62. - void **set_ignore_camera_zoom** **(** :ref:`bool<class_bool>` value **)**
  63. - :ref:`bool<class_bool>` **is_ignore_camera_zoom** **(** **)**
  64. If ``true``, elements in :ref:`ParallaxLayer<class_ParallaxLayer>` child aren't affected by the zoom level of the camera.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_ParallaxBackground_property_scroll_limit_begin:
  68. .. rst-class:: classref-property
  69. :ref:`Vector2<class_Vector2>` **scroll_limit_begin** = ``Vector2( 0, 0 )``
  70. .. rst-class:: classref-property-setget
  71. - void **set_limit_begin** **(** :ref:`Vector2<class_Vector2>` value **)**
  72. - :ref:`Vector2<class_Vector2>` **get_limit_begin** **(** **)**
  73. 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.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_ParallaxBackground_property_scroll_limit_end:
  77. .. rst-class:: classref-property
  78. :ref:`Vector2<class_Vector2>` **scroll_limit_end** = ``Vector2( 0, 0 )``
  79. .. rst-class:: classref-property-setget
  80. - void **set_limit_end** **(** :ref:`Vector2<class_Vector2>` value **)**
  81. - :ref:`Vector2<class_Vector2>` **get_limit_end** **(** **)**
  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. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_ParallaxBackground_property_scroll_offset:
  86. .. rst-class:: classref-property
  87. :ref:`Vector2<class_Vector2>` **scroll_offset** = ``Vector2( 0, 0 )``
  88. .. rst-class:: classref-property-setget
  89. - void **set_scroll_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  90. - :ref:`Vector2<class_Vector2>` **get_scroll_offset** **(** **)**
  91. 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.
  92. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  93. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  94. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  95. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`