Options
All
  • Public
  • Public/Protected
  • All
Menu

The occlusion mask which contains radial occlusion and vision occlusion from tokens.

Hierarchy

Index

Constructors

Properties

tokens: any

Graphics in which token radial and vision occlusion shapes are drawn.

clearColor: number[] = ...
override
alphaMode: ALPHA_MODES
displayed: boolean = false

Should our Container also be displayed on screen, in addition to being drawn to the cached RenderTexture?

_renderPaths: Map<RenderTexture, any> = ...

An map of render textures, linked to their render function and an optional RGBA clear color.

textureConfiguration: { scaleMode: any; format: any } = ...
override

Type declaration

  • scaleMode: any
  • format: any

Methods

  • clear(): void
  • updateOcclusion(): void
  • Update the state of occlusion, rendering a new occlusion mask and updating the occluded flag on all Tiles.

    Returns void

  • createRenderTexture([options={}]?: { renderFunction: Function; clearColor: number[] }): RenderTexture
  • Create a render texture, provide a render method and an optional clear color.

    Parameters

    • [options={}]: { renderFunction: Function; clearColor: number[] } = {}

      Optional parameters.

      • renderFunction: Function
      • clearColor: number[]

    Returns RenderTexture

    A reference to the created render texture.

  • removeRenderTexture(renderTexture: RenderTexture, destroy?: boolean): void
  • Remove a previously created render texture.

    Parameters

    • renderTexture: RenderTexture

      The render texture to remove.

    • destroy: boolean = true

    Returns void

  • destroy(options: any): void
  • render(renderer: any): void
  • _identifyOccludedObjects(tokens: Token[]): Set<((DisplayObject: any) => any)>
  • Determine the set of objects which should be currently occluded by a Token.

    Parameters

    • tokens: Token[]

      The set of currently controlled Token objects

    Returns Set<((DisplayObject: any) => any)>

    The PCO objects which should be currently occluded

  • #renderSecondary(renderer: Renderer): void
  • Custom rendering for secondary render textures

    Parameters

    • renderer: Renderer

      The active canvas renderer.

    Returns void

  • #bind(renderer: Renderer, tex: RenderTexture, clearColor: number[]): void
  • Bind a render texture to this renderer. Must be called after bindPrimaryBuffer and before bindInitialBuffer.

    Parameters

    • renderer: Renderer

      The active canvas renderer.

    • tex: RenderTexture

      The texture to bind.

    • clearColor: number[]

    Returns void

  • #createOcclusion(): void
  • Initialize the depth mask with the roofs container and token graphics.

    Returns void

  • #drawTokenOcclusion(tokens: Token[]): void
  • Draw occlusion shapes to the Tile occlusion mask. Radial occlusion draws to the green channel with varying intensity from [1/255, 1] based on elevation. Vision occlusion draws to the blue channel with varying intensity from [1/255, 1] based on elevation.

    Parameters

    • tokens: Token[]

      An array of currently controlled or observed tokens

    Returns void

  • #updateTileOcclusion(tokens: Token[]): void
  • Update the current occlusion status of all Tile objects.

    Parameters

    • tokens: Token[]

      The set of currently controlled Token objects

    Returns void

  • resizeRenderTexture(renderer: Renderer, rt: RenderTexture): void
  • Resize a render texture passed as a parameter with the renderer.

    Parameters

    • renderer: Renderer

      The active canvas renderer.

    • rt: RenderTexture

      The render texture to resize.

    Returns void

Accessors

  • get sprite(): any
  • set sprite(sprite: any): void
  • A PIXI.Sprite or SpriteMesh which is bound to this CachedContainer. The RenderTexture from this Container is associated with the Sprite which is automatically rendered.

    Returns any

  • A PIXI.Sprite or SpriteMesh which is bound to this CachedContainer. The RenderTexture from this Container is associated with the Sprite which is automatically rendered.

    Parameters

    • sprite: any

    Returns void

  • get renderTexture(): RenderTexture
  • The primary render texture bound to this cached container.

    Returns RenderTexture