LayerMixin.moveBefore

Moves this layer immediately before the given sibling in render order.

LayerMixin.moveBefore() method

Moves this layer immediately before (visually above) the given sibling in render order.

Signature:

moveBefore(sibling: Layer): void;

Parameters

Parameter

Type

Description

sibling

Layer

The layer to move this layer before. Must be in the same scene.

Returns: void

Remarks

Throws if sibling belongs to a different scene. Layers cannot be reparented across scenes via this method.

Example

const [first, second] = creator.activeScene.layers;
second.moveBefore(first); // second now renders above first
Last updated: August 5, 2026 at 11:47 AMEdit this page