Class Layer
Hierarchy
- Layer
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Instantiates a new layer. This represents a full screen 2d layer. This can be useful to display a picture in the background of your scene for instance.
Parameters
-
name: string
Define the name of the layer in the scene
-
imgUrl: Nullable<string>
Define the url of the texture to display in the layer
-
scene: Nullable<Scene>
Define the scene the layer belongs to
-
Optional isBackground: boolean
Defines whether the layer is displayed in front or behind the scene
-
Optional color: Color4
Defines a color for the layer
Returns Layer
-
Properties
alpha Blending ModeSearch playground for alphaBlendingMode
Define the alpha blending mode used in the layer in case the texture or color has an alpha.
alpha TestSearch playground for alphaTest
Define if the layer should alpha test or alpha blend with the rest of the scene. Alpha test will not mix with the background color in case of transparency. It will either use the texture color or the background depending on the alpha value of the current pixel.
colorSearch playground for color
Define the color of the layer (instead of texture).
is BackgroundSearch playground for isBackground
Is the layer in background or foreground.
layer MaskSearch playground for layerMask
Define a mask to restrict the layer to only some of the scene cameras.
nameSearch playground for name
Define the name of the layer.
offsetSearch playground for offset
Define an offset for the layer in order to shift the texture.
on After Render ObservableSearch playground for onAfterRenderObservable
An event triggered after rendering the scene
on Before Render ObservableSearch playground for onBeforeRenderObservable
An event triggered before rendering the scene
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the layer is disposed.
render Only InRender Target TexturesSearch playground for renderOnlyInRenderTargetTextures
Define if the layer is only used in renderTarget or if it also renders in the main frame buffer of the canvas.
render Target TexturesSearch playground for renderTargetTextures
Define the list of render target the layer is visible into.
scaleSearch playground for scale
Define the scale of the layer in order to zoom in out of the texture.
textureSearch playground for texture
Define the texture the layer should display.
Accessors
on After Render
-
Back compatibility with callback before the onAfterRenderObservable existed. The set callback will be triggered just after rendering the layer.
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
on Before Render
-
Back compatibility with callback before the onBeforeRenderObservable existed. The set callback will be triggered just before rendering the layer.
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
on Dispose
-
Back compatibility with callback before the onDisposeObservable existed. The set callback will be triggered when the layer has been disposed.
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
Methods
disposeSearch playground for dispose
-
Disposes and releases the associated ressources.
Returns void
renderSearch playground for render
-
Renders the layer in the scene.
Returns void
This represents a full screen 2d layer. This can be useful to display a picture in the background of your scene for instance.
https://www.babylonjs-playground.com/#08A2BS#1