ParallaxLayer
ParallaxLayer(
props):Element
A background or foreground on a 2D game’s plane that moves at a share
of the camera’s movement, the parallax of a side-scroller’s hills and
sky, as Godot’s Parallax2D and Phaser’s scrollFactor give one. It
reads the scene’s Camera2D after the camera moves each frame, places
its children on the camera’s texel grid while the camera is
pixel-perfect, and moves nothing in the simulation. It places its
children in world metres, so it stands at the scene’s root or inside
Landscape, under no moved, turned or scaled group. A view: a room
never mounts it. Its depth along the camera orders it: on the side
plane a layer at a negative z draws behind the scene, and one at a
positive z in front. The camera’s shake moves every layer alike.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
props |
ParallaxLayerProps |
Returns
Section titled “Returns”Element