W3cubDocs

/Godot 3.1

ParallaxBackground

Inherits: CanvasLayer < Node < Object

Category: Core

Brief Description

A node used to create a parallax scrolling background.

Properties

Vector2 scroll_base_offset
Vector2 scroll_base_scale
bool scroll_ignore_camera_zoom
Vector2 scroll_limit_begin
Vector2 scroll_limit_end
Vector2 scroll_offset

Description

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.

Property Descriptions

Vector2 scroll_base_offset

Setter set_scroll_base_offset(value)
Getter get_scroll_base_offset()

Base position offset of all ParallaxLayer children.

Vector2 scroll_base_scale

Setter set_scroll_base_scale(value)
Getter get_scroll_base_scale()

Base motion scale of all ParallaxLayer children.

bool scroll_ignore_camera_zoom

Setter set_ignore_camera_zoom(value)
Getter is_ignore_camera_zoom()

If true, elements in ParallaxLayer child aren’t affected by the zoom level of the camera.

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 scroll_limit_end to work.

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 scroll_limit_begin to work.

Vector2 scroll_offset

Setter set_scroll_offset(value)
Getter get_scroll_offset()

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–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/3.1/classes/class_parallaxbackground.html