A CanvasLayer for displaying illumination visual effects

Hierarchy (view full)

Properties

The filter used to mask visual effects on this layer

lights: Container = ...

The container holding the lights.

backgroundColorTexture: Texture

A minimalist texture that holds the background color.

baselineMesh: SpriteMesh = ...

The base line mesh.

darknessLevelMeshes: CachedContainer = ...

The cached container holding the illumination meshes.

options: {
    name: string;
} = ...

Options for this layer instance.

Type declaration

  • name: string
#backgroundColorRGB: number[]

The background color rgb array.

#drawing: Promise<CanvasLayer> = ...

An internal reference to a Promise in-progress to draw the CanvasLayer.

#drawn: boolean = false

Is the layer drawn?

Accessors

  • get hasDynamicDarknessLevel(): boolean
  • To know if dynamic darkness level is active on this scene.

    Returns boolean

  • get renderTexture(): RenderTexture
  • The illumination render texture.

    Returns RenderTexture

  • set backgroundColor(color): void
  • Set or retrieve the illumination background color.

    Parameters

    • color: number

    Returns void

  • get name(): string
  • The canonical name of the CanvasLayer is the name of the constructor that is the immediate child of the defined baseClass for the layer type.

    Returns string

    Example

    canvas.lighting.name -> "LightingLayer"
    
  • get hookName(): string
  • The name used by hooks to construct their hook string. Note: You should override this getter if hookName should not return the class constructor name.

    Returns string

  • get layerOptions(): {
        name: string;
    }
  • Customize behaviors of this CanvasLayer by modifying some behaviors at a class level.

    Returns {
        name: string;
    }

    • name: string
  • get instance(): CanvasLayer
  • Return a reference to the active instance of this canvas layer

    Returns CanvasLayer

Methods

  • Clear illumination effects container

    Returns void

  • Invalidate the cached container state to trigger a render pass.

    Parameters

    • Optional force: boolean = false

      Force cached container invalidation?

    Returns void

  • Parameters

    • renderer: any

    Returns void

  • Parameters

    • options: any

    Returns Promise<void>

  • Parameters

    • options: any

    Returns Promise<void>

  • Draw the canvas layer, rendering its internal components and returning a Promise. The Promise resolves to the drawn layer once its contents are successfully rendered.

    Parameters

    • Optional options: object = {}

      Options which configure how the layer is drawn

    Returns Promise<CanvasLayer>

  • Deconstruct data used in the current layer in preparation to re-draw the canvas

    Parameters

    • Optional options: object = {}

      Options which configure how the layer is deconstructed

    Returns Promise<CanvasLayer>

  • Protected

    Create the background color texture used by illumination point source meshes. 1x1 single pixel texture.

    Returns Texture

    The background color texture.

  • Initialize the layer.

    Returns void