class_parallaxbackground.rst 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. Properties
  13. ----------
  14. +-------------------------------+-----------------------------------------------------------------------------------------------+
  15. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_offset<class_ParallaxBackground_property_scroll_base_offset>` |
  16. +-------------------------------+-----------------------------------------------------------------------------------------------+
  17. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_scale<class_ParallaxBackground_property_scroll_base_scale>` |
  18. +-------------------------------+-----------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`scroll_ignore_camera_zoom<class_ParallaxBackground_property_scroll_ignore_camera_zoom>` |
  20. +-------------------------------+-----------------------------------------------------------------------------------------------+
  21. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_begin<class_ParallaxBackground_property_scroll_limit_begin>` |
  22. +-------------------------------+-----------------------------------------------------------------------------------------------+
  23. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_end<class_ParallaxBackground_property_scroll_limit_end>` |
  24. +-------------------------------+-----------------------------------------------------------------------------------------------+
  25. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_offset<class_ParallaxBackground_property_scroll_offset>` |
  26. +-------------------------------+-----------------------------------------------------------------------------------------------+
  27. Description
  28. -----------
  29. 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>`.
  30. Property Descriptions
  31. ---------------------
  32. .. _class_ParallaxBackground_property_scroll_base_offset:
  33. - :ref:`Vector2<class_Vector2>` **scroll_base_offset**
  34. +----------+-------------------------------+
  35. | *Setter* | set_scroll_base_offset(value) |
  36. +----------+-------------------------------+
  37. | *Getter* | get_scroll_base_offset() |
  38. +----------+-------------------------------+
  39. Base position offset of all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
  40. .. _class_ParallaxBackground_property_scroll_base_scale:
  41. - :ref:`Vector2<class_Vector2>` **scroll_base_scale**
  42. +----------+------------------------------+
  43. | *Setter* | set_scroll_base_scale(value) |
  44. +----------+------------------------------+
  45. | *Getter* | get_scroll_base_scale() |
  46. +----------+------------------------------+
  47. Base motion scale of all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
  48. .. _class_ParallaxBackground_property_scroll_ignore_camera_zoom:
  49. - :ref:`bool<class_bool>` **scroll_ignore_camera_zoom**
  50. +----------+-------------------------------+
  51. | *Setter* | set_ignore_camera_zoom(value) |
  52. +----------+-------------------------------+
  53. | *Getter* | is_ignore_camera_zoom() |
  54. +----------+-------------------------------+
  55. If ``true``, elements in :ref:`ParallaxLayer<class_ParallaxLayer>` child aren't affected by the zoom level of the camera.
  56. .. _class_ParallaxBackground_property_scroll_limit_begin:
  57. - :ref:`Vector2<class_Vector2>` **scroll_limit_begin**
  58. +----------+------------------------+
  59. | *Setter* | set_limit_begin(value) |
  60. +----------+------------------------+
  61. | *Getter* | get_limit_begin() |
  62. +----------+------------------------+
  63. 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.
  64. .. _class_ParallaxBackground_property_scroll_limit_end:
  65. - :ref:`Vector2<class_Vector2>` **scroll_limit_end**
  66. +----------+----------------------+
  67. | *Setter* | set_limit_end(value) |
  68. +----------+----------------------+
  69. | *Getter* | get_limit_end() |
  70. +----------+----------------------+
  71. 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.
  72. .. _class_ParallaxBackground_property_scroll_offset:
  73. - :ref:`Vector2<class_Vector2>` **scroll_offset**
  74. +----------+--------------------------+
  75. | *Setter* | set_scroll_offset(value) |
  76. +----------+--------------------------+
  77. | *Getter* | get_scroll_offset() |
  78. +----------+--------------------------+
  79. 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.