A subclass of CanvasLayer which provides support for user interaction with its contained objects.

Hierarchy (view full)

Properties

eventMode: string = "passive"
options: {
    name: string;
} = ...

Options for this layer instance.

Type declaration

  • name: string
#drawing: Promise<CanvasLayer> = ...

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

#drawn: boolean = false

Is the layer drawn?

Accessors

  • get active(): boolean
  • Is this layer currently active

    Returns boolean

  • 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;
        zIndex: number;
    }
  • Customize behaviors of this CanvasLayer by modifying some behaviors at a class level.

    Returns {
        name: string;
        zIndex: number;
    }

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

    Returns CanvasLayer

Methods

  • Activate the InteractionLayer, deactivating other layers and marking this layer's children as interactive.

    Parameters

    • Optional options: {
          tool: string;
      } = {}

      Options which configure layer activation

      • tool: string

        A specific tool in the control palette to set as active

    Returns InteractionLayer

    The layer instance, now activated

  • Deactivate the InteractionLayer, removing interactivity from its children.

    Returns InteractionLayer

    The layer instance, now inactive

  • Parameters

    • options: any

    Returns Promise<void>

  • Get the zIndex that should be used for ordering this layer vertically relative to others in the same Container.

    Returns number

  • 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: any = {}

      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: any = {}

      Options which configure how the layer is deconstructed

    Returns Promise<CanvasLayer>

  • Protected

    The inner _activate method which may be defined by each InteractionLayer subclass.

    Returns void

  • Protected

    The inner _deactivate method which may be defined by each InteractionLayer subclass.

    Returns void

  • Protected

    Handle left mouse-click events which originate from the Canvas stage.

    Parameters

    • event: FederatedEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

    See

    Canvas._onClickLeft

  • Protected

    Handle double left-click events which originate from the Canvas stage.

    Parameters

    • event: FederatedEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

    See

    Canvas.#onClickLeft2

  • Protected

    Does the User have permission to left-click drag on the Canvas?

    Parameters

    • user: User

      The User performing the action.

    • event: FederatedEvent

      The event object.

    Returns boolean

  • Protected

    Start a left-click drag workflow originating from the Canvas stage.

    Parameters

    • event: FederatedEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

    See

    Canvas.#onDragLeftStart

  • Protected

    Continue a left-click drag workflow originating from the Canvas stage.

    Parameters

    • event: FederatedEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

    See

    Canvas.#onDragLeftMove

  • Protected

    Conclude a left-click drag workflow originating from the Canvas stage.

    Parameters

    • event: FederatedEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

    See

    Canvas.#onDragLeftDrop

  • Protected

    Cancel a left-click drag workflow originating from the Canvas stage.

    Parameters

    • event: PointerEvent

      A right-click pointer event on the document.

    Returns void

    See

    Canvas.#onDragLeftDrop

  • Protected

    Handle right mouse-click events which originate from the Canvas stage.

    Parameters

    • event: FederatedEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

    See

    Canvas._onClickRight

  • Protected

    Handle mouse-wheel events which occur for this active layer.

    Parameters

    • event: WheelEvent

      The WheelEvent initiated on the document

    Returns void

  • Protected

    Handle a DELETE keypress while this layer is active.

    Parameters

    • event: KeyboardEvent

      The delete key press event

    Returns Promise<void>

  • Protected

    The inner _tearDown method which may be customized by each CanvasLayer subclass.

    Parameters

    • options: any

      Options which configure how the layer is deconstructed

    Returns Promise<void>