Options
All
  • Public
  • Public/Protected
  • All
Menu

A CanvasLayer for displaying illumination visual effects

Hierarchy

Index

Constructors

Properties

backgroundColorTexture: Texture

A minimalist texture that holds the background color.

background: any
lights: any

The filter used to mask visual effects on this layer

darknessLevel: any
filterArea: any
options: { name: string } = ...

Options for this layer instance.

Type declaration

  • name: string
interactiveChildren: boolean = false
renderable: boolean

Accessors

  • get globalLight(): boolean
  • Is global illumination currently applied to the canvas?

    Returns boolean

  • set backgroundColor(color: number): 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.

    example

    canvas.lighting.name -> "LightingLayer" canvas.grid.name -> "GridLayer"

    Returns string

  • 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
  • Return a reference to the active instance of this canvas layer

    Returns CanvasLayer

Methods

  • clear(): void
  • Clear illumination effects container

    Returns void

  • render(renderer: any): void
  • override

    Parameters

    • renderer: any

    Returns void

  • _draw(options: any): Promise<void>
  • _tearDown(options: any): Promise<void>
  • drawBaseline(): void
  • Draw illumination baseline

    Returns 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

    • options: any = {}

    Returns Promise<CanvasLayer>

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

    Parameters

    • options: any = {}

    Returns Promise<CanvasLayer>

  • _createBackgroundColorTexture(): Texture
  • Create the background color texture used by illumination point source meshes. 1x1 single pixel texture.

    Returns Texture

    The background color texture.