mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
128 lines
5.5 KiB
ReStructuredText
128 lines
5.5 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the ParallaxBackground.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_ParallaxBackground:
|
|
|
|
ParallaxBackground
|
|
==================
|
|
|
|
**Inherits:** :ref:`CanvasLayer<class_CanvasLayer>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
A node used to create a parallax scrolling background.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_offset<class_ParallaxBackground_property_scroll_base_offset>` |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`scroll_base_scale<class_ParallaxBackground_property_scroll_base_scale>` |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`scroll_ignore_camera_zoom<class_ParallaxBackground_property_scroll_ignore_camera_zoom>` |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_begin<class_ParallaxBackground_property_scroll_limit_begin>` |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`scroll_limit_end<class_ParallaxBackground_property_scroll_limit_end>` |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`scroll_offset<class_ParallaxBackground_property_scroll_offset>` |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------+
|
|
|
|
Description
|
|
-----------
|
|
|
|
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>`.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_ParallaxBackground_property_scroll_base_offset:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **scroll_base_offset**
|
|
|
|
+----------+-------------------------------+
|
|
| *Setter* | set_scroll_base_offset(value) |
|
|
+----------+-------------------------------+
|
|
| *Getter* | get_scroll_base_offset() |
|
|
+----------+-------------------------------+
|
|
|
|
Base position offset of all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
|
|
|
|
----
|
|
|
|
.. _class_ParallaxBackground_property_scroll_base_scale:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **scroll_base_scale**
|
|
|
|
+----------+------------------------------+
|
|
| *Setter* | set_scroll_base_scale(value) |
|
|
+----------+------------------------------+
|
|
| *Getter* | get_scroll_base_scale() |
|
|
+----------+------------------------------+
|
|
|
|
Base motion scale of all :ref:`ParallaxLayer<class_ParallaxLayer>` children.
|
|
|
|
----
|
|
|
|
.. _class_ParallaxBackground_property_scroll_ignore_camera_zoom:
|
|
|
|
- :ref:`bool<class_bool>` **scroll_ignore_camera_zoom**
|
|
|
|
+----------+-------------------------------+
|
|
| *Setter* | set_ignore_camera_zoom(value) |
|
|
+----------+-------------------------------+
|
|
| *Getter* | is_ignore_camera_zoom() |
|
|
+----------+-------------------------------+
|
|
|
|
If ``true``, elements in :ref:`ParallaxLayer<class_ParallaxLayer>` child aren't affected by the zoom level of the camera.
|
|
|
|
----
|
|
|
|
.. _class_ParallaxBackground_property_scroll_limit_begin:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **scroll_limit_begin**
|
|
|
|
+----------+------------------------+
|
|
| *Setter* | set_limit_begin(value) |
|
|
+----------+------------------------+
|
|
| *Getter* | get_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_property_scroll_limit_end>` to work.
|
|
|
|
----
|
|
|
|
.. _class_ParallaxBackground_property_scroll_limit_end:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **scroll_limit_end**
|
|
|
|
+----------+----------------------+
|
|
| *Setter* | set_limit_end(value) |
|
|
+----------+----------------------+
|
|
| *Getter* | get_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_property_scroll_limit_begin>` to work.
|
|
|
|
----
|
|
|
|
.. _class_ParallaxBackground_property_scroll_offset:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **scroll_offset**
|
|
|
|
+----------+--------------------------+
|
|
| *Setter* | set_scroll_offset(value) |
|
|
+----------+--------------------------+
|
|
| *Getter* | get_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.
|
|
|