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.
Property | Description |
---|---|
| (get) END_COUNT: undefined END_COUNT may be used for 'count' parameter to move to top with moveUp(), or to the bottom with moveDown() |
Method | Description |
---|---|
| create(properties: {hidden: boolean, name: string, renderOrder: number}): Promise<Layer> Creates a new layer with specified properties |
| destroy(l: Layer, option: DestroyOption): Promise<void> Destroy the specfied layer. Only layers created dynamically through 'create' may be destroyed. |
| findFirst(name: string): Promise<Layer | null> Finds the first layer of a specified name |
| findUsingPattern(namePattern: string, config?: {limit: number}): Promise<Array<Layer>> Return layers whose name match the pattern specified |
| getAll(): Promise<Array<Layer>> Returns an array of all layers |
| getLayer(obj: SceneObjectBase): Promise<Layer | null> Get the layer, if it has one, that the specified scene object belongs to |
| 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(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(obj: SceneObjectBase, lyr: Layer): Promise<void> Set the layer that a scene object should belong to |