A node used to create a parallax scrolling background.
    public class ParallaxBackground : CanvasLayer

A ParallaxBackground uses one or more ParallaxLayer child nodes to create a parallax effect. Each ParallaxLayer can move at a different speed using ParallaxLayer.MotionOffset. This creates an illusion of depth in a 2D game. If not used with a Camera2D, you must manually calculate the ScrollOffset.

Inheritance Chain

Constructors

    public ParallaxBackground()

Properties

    public Vector2 ScrollBaseOffset { get; set; }

The base position offset for all ParallaxLayer children.

    public Vector2 ScrollBaseScale { get; set; }

The base motion scale for all ParallaxLayer children.

    public bool ScrollIgnoreCameraZoom { get; set; }

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

    public Vector2 ScrollLimitBegin { get; set; }

Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than ScrollLimitEnd to work.

    public Vector2 ScrollLimitEnd { get; set; }

Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than ScrollLimitBegin to work.

    public Vector2 ScrollOffset { get; set; }

The ParallaxBackground’s scroll value. Calculated automatically when using a Camera2D, but can be used to manually manage scrolling when no camera is present.

Methods

    [Obsolete("GetLimitBegin is deprecated. Use the ScrollLimitBegin property instead.")]
    public Vector2 GetLimitBegin()

Getter for ScrollLimitBegin

    [Obsolete("GetLimitEnd is deprecated. Use the ScrollLimitEnd property instead.")]
    public Vector2 GetLimitEnd()

Getter for ScrollLimitEnd

    [Obsolete("GetScrollBaseOffset is deprecated. Use the ScrollBaseOffset property instead.")]
    public Vector2 GetScrollBaseOffset()

Getter for ScrollBaseOffset

    [Obsolete("GetScrollBaseScale is deprecated. Use the ScrollBaseScale property instead.")]
    public Vector2 GetScrollBaseScale()

Getter for ScrollBaseScale

    [Obsolete("GetScrollOffset is deprecated. Use the ScrollOffset property instead.")]
    public Vector2 GetScrollOffset()

Getter for ScrollOffset

    [Obsolete("IsIgnoreCameraZoom is deprecated. Use the ScrollIgnoreCameraZoom property instead.")]
    public bool IsIgnoreCameraZoom()

Getter for ScrollIgnoreCameraZoom

    [Obsolete("SetIgnoreCameraZoom is deprecated. Use the ScrollIgnoreCameraZoom property instead.")]
    public void SetIgnoreCameraZoom(bool ignore)

Setter for ScrollIgnoreCameraZoom

    [Obsolete("SetLimitBegin is deprecated. Use the ScrollLimitBegin property instead.")]
    public void SetLimitBegin(Vector2 ofs)

Setter for ScrollLimitBegin

    [Obsolete("SetLimitEnd is deprecated. Use the ScrollLimitEnd property instead.")]
    public void SetLimitEnd(Vector2 ofs)

Setter for ScrollLimitEnd

    [Obsolete("SetScrollBaseOffset is deprecated. Use the ScrollBaseOffset property instead.")]
    public void SetScrollBaseOffset(Vector2 ofs)

Setter for ScrollBaseOffset

    [Obsolete("SetScrollBaseScale is deprecated. Use the ScrollBaseScale property instead.")]
    public void SetScrollBaseScale(Vector2 scale)

Setter for ScrollBaseScale

    [Obsolete("SetScrollOffset is deprecated. Use the ScrollOffset property instead.")]
    public void SetScrollOffset(Vector2 ofs)

Setter for ScrollOffset

Tags: