/Godot 3.1


Inherits: Node2D < CanvasItem < Node < Object

Category: Core

Brief Description

A parallax scrolling layer to be used with ParallaxBackground.


Vector2 motion_mirroring
Vector2 motion_offset
Vector2 motion_scale


A ParallaxLayer must be the child of a ParallaxBackground node. Each ParallaxLayer can be set to move at different speeds relative to the camera movement or the ParallaxBackground.scroll_offset value.

This node’s children will be affected by its scroll offset.

Note that any changes to this node’s position and scale made after it enters the scene will be ignored.

Property Descriptions

Vector2 motion_mirroring

Setter set_mirroring(value)
Getter get_mirroring()

The ParallaxLayer’s Texture mirroring. Useful for creating an infinite scrolling background. If an axis is set to 0 the Texture will not be mirrored. Default value: (0, 0).

Vector2 motion_offset

Setter set_motion_offset(value)
Getter get_motion_offset()

The ParallaxLayer’s offset relative to the parent ParallaxBackground’s ParallaxBackground.scroll_offset.

Vector2 motion_scale

Setter set_motion_scale(value)
Getter get_motion_scale()

Multiplies the ParallaxLayer’s motion. If an axis is set to 0 it will not scroll.

© 2014–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.