Scripting API
LayersModule
LayersModule Overview

LayersModule

The LayersModule class provides access to layers. It allow dynamic creation
and destruction of layers, modifying layer properties such as render order,
as well as changing what layer a scene object is in.

Example

Properties

PropertyDescription
END_COUNT
(get) END_COUNT: undefined
(set) END_COUNT: undefined


END_COUNT may be used for 'count' parameter to move to top with moveUp(), or to the bottom with moveDown()

Methods

MethodDescription
create
create(properties: {hidden: boolean, name: string, renderOrder: number}): Promise<Layer>


Creates a new layer with specified properties
destroy
destroy(l: Layer, option: DestroyOption): Promise<void>


Destroy the specfied layer. Only layers created dynamically through 'create' may be destroyed.
findFirst
findFirst(name: string): Promise<Layer | null>


Finds the first layer of a specified name
findUsingPattern
findUsingPattern(namePattern: string, config?: {limit: number}): Promise<Array<Layer>>


Return layers whose name match the pattern specified
getAll
getAll(): Promise<Array<Layer>>


Returns an array of all layers
getLayer
getLayer(obj: SceneObjectBase): Promise<Layer | null>


Get the layer, if it has one, that the specified scene object belongs to
moveDown
moveDown(l: Layer, count: number): Promise<number>


Change the rendering order of a layer, moving it down so that it renders sooner. Returns new render order.
moveUp
moveUp(l: Layer, count: number): Promise<number>


Change the rendering order of a layer, moving it up so that it renders later. Returns new render order.
setLayer
setLayer(obj: SceneObjectBase, lyr: Layer): Promise<void>


Set the layer that a scene object should belong to

Classes

ClassDescription