ParallaxLayer

Inherits: Node2D < CanvasItem < Node < Object

使用 ParallaxBackground 的视差滚动层。

描述

ParallaxLayer 必须是 ParallaxBackground 节点的子节点。每个 ParallaxLayer 都可以设置为相对于相机移动或 ParallaxBackground.scroll_offset 值。

该节点的子节点将受其滚动偏移量的影响。

注意: 当该节点进入场景后,对其位置和比例的任何改变都将被忽略。

属性

Vector2

motion_mirroring

Vector2( 0, 0 )

Vector2

motion_offset

Vector2( 0, 0 )

Vector2

motion_scale

Vector2( 1, 1 )

属性说明

Default

Vector2( 0, 0 )

Setter

set_mirroring(value)

Getter

get_mirroring()

视差图层的Texture镜像。用于创建无限滚动的背景。如果一个轴被设置为0Texture将不会被镜像。


Default

Vector2( 0, 0 )

Setter

set_motion_offset(value)

Getter

get_motion_offset()

ParallaxLayer相对于父ParallaxBackground的偏移量ParallaxBackground.scroll_offset


Default

Vector2( 1, 1 )

Setter

set_motion_scale(value)

Getter

get_motion_scale()

复制视差图层的运动。如果一个轴被设置为0,它将不会滚动。