Options
All
  • Public
  • Public/Protected
  • All
Menu

This represents a full screen 2d layer. This can be useful to display a picture in the background of your scene for instance.

see

https://www.babylonjs-playground.com/#08A2BS#1

Hierarchy

  • Layer

Index

Constructors

  • 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.

    see

    https://www.babylonjs-playground.com/#08A2BS#1

    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

alphaBlendingMode: number

Define the alpha blending mode used in the layer in case the texture or color has an alpha.

alphaTest: boolean

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.

color: Color4

Define the color of the layer (instead of texture).

isBackground: boolean

Is the layer in background or foreground.

isEnabled: boolean

Define if the layer is enabled (ie. should be displayed). Default: true

layerMask: number

Define a mask to restrict the layer to only some of the scene cameras.

name: string

Define the name of the layer.

offset: Vector2

Define an offset for the layer in order to shift the texture.

onAfterRenderObservable: Observable<Layer>

An event triggered after rendering the scene

onBeforeRenderObservable: Observable<Layer>

An event triggered before rendering the scene

onDisposeObservable: Observable<Layer>

An event triggered when the layer is disposed.

renderOnlyInRenderTargetTextures: boolean

Define if the layer is only used in renderTarget or if it also renders in the main frame buffer of the canvas.

renderTargetTextures: RenderTargetTexture[]

Define the list of render target the layer is visible into.

scale: Vector2

Define the scale of the layer in order to zoom in out of the texture.

Define the texture the layer should display.

Accessors

  • get applyPostProcess(): boolean
  • set applyPostProcess(value: boolean): void
  • Determines if the layer is drawn before (true) or after (false) post-processing. If the layer is background, it is always before.

    Returns boolean

  • Determines if the layer is drawn before (true) or after (false) post-processing. If the layer is background, it is always before.

    Parameters

    • value: boolean

    Returns void

  • set onAfterRender(callback: (() => void)): void
  • Back compatibility with callback before the onAfterRenderObservable existed. The set callback will be triggered just after rendering the layer.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • set onBeforeRender(callback: (() => void)): void
  • Back compatibility with callback before the onBeforeRenderObservable existed. The set callback will be triggered just before rendering the layer.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • set onDispose(callback: (() => void)): void
  • Back compatibility with callback before the onDisposeObservable existed. The set callback will be triggered when the layer has been disposed.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

Methods

  • dispose(): void
  • Disposes and releases the associated resources.

    Returns void

  • isReady(): undefined | boolean
  • Checks if the layer is ready to be rendered

    Returns undefined | boolean

    true if the layer is ready. False otherwise.

  • render(): void
  • Renders the layer in the scene.

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme