Inherits: CanvasLayer < Node < Object
A node used to create a parallax scrolling background.
A ParallaxBackground uses one or more ParallaxLayer child nodes to create a parallax effect. Each ParallaxLayer can move at a different speed using ParallaxLayer.motion_offset. This creates an illusion of depth in a 2D game. If not used with a Camera2D, you must manually calculate the scroll_offset.
Note: Each ParallaxBackground is drawn on one specific Viewport and cannot be shared between multiple Viewports, see CanvasLayer.custom_viewport. When using multiple Viewports, for example in a split-screen game, you need create an individual ParallaxBackground for each Viewport you want it to be drawn on.
layer |
| |
| ||
| ||
| ||
| ||
| ||
|
Vector2(0, 0)
The base position offset for all ParallaxLayer children.
Vector2(1, 1)
The base motion scale for all ParallaxLayer children.
false
If true, elements in ParallaxLayer child aren't affected by the zoom level of the camera.
Vector2(0, 0)
Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than scroll_limit_end to work.
Vector2(0, 0)
Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than scroll_limit_begin to work.
Vector2(0, 0)
The ParallaxBackground's scroll value. Calculated automatically when using a Camera2D, but can be used to manually manage scrolling when no camera is present.
© 2014–present Juan Linietsky, Ariel Manzur and the Godot community
Licensed under the Creative Commons Attribution Unported License v3.0.
https://docs.godotengine.org/en/4.2/classes/class_parallaxbackground.html