CLASSES
TagsA - Z

Layer

Description

class Layer

Create a new 2D layer (used to represents backgrounds and/or foregrounds)

Constructor

new Layer(name, imgUrl, scene, isBackground, color)

The Layer constructor

Parameters

Name Type Description
name string The layer name
imgUrl string The texture URL to display for this layer
scene Scene The scene linked to this layer
optional isBackground boolean If set to true, then this layer will be displayed as a background

Members

name : string

The layer name

texture : Texture

The texture to display for this layer

isBackground : boolean

If set to true, then this layer will be displayed as a background.

color : Color4

The color of this layer

scale : Vector2

offset : Vector2

alphaBlendingMode : number

alphaTest : boolean

onDisposeObservable : Observable<Layer>

An event triggered when the layer is disposed.

@type {BABYLON.Observable}

onDispose : () => void

Dispose

onBeforeRenderObservable : Observable<Layer>

An event triggered before rendering the scene

@type {BABYLON.Observable}

onBeforeRender : () => void

onAfterRenderObservable : Observable<Layer>

An event triggered after rendering the scene

@type {BABYLON.Observable}

onAfterRender : () => void

Methods

render() → void

Function used to render this layer

dispose() → void