Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

Index

Constructors

Accessors

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

    Returns boolean

  • get name(): string
  • The canonical name of the CanvasLayer

    Returns string

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

    Returns { name: string; sortActiveTop: boolean; zIndex: number }

    • name: string
    • sortActiveTop: boolean
    • zIndex: number
  • 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

    • [options]: { tool: string } = {}

      Options which configure layer activation

      • tool: string

    Returns InteractionLayer

    The layer instance, now activated

  • Deactivate the InteractionLayer, removing interactivity from its children.

    Returns InteractionLayer

    The layer instance, now inactive

  • _draw(options: any): Promise<void>
  • getZIndex(): number
  • 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

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

  • _activate(): void
  • The inner _activate method which may be defined by each InteractionLayer subclass.

    Returns void

  • _deactivate(): void
  • The inner _deactivate method which may be defined by each InteractionLayer subclass.

    Returns void

  • _onClickLeft(event: InteractionEvent): void
  • Handle left mouse-click events which originate from the Canvas stage.

    see

    Canvas._onClickLeft

    Parameters

    • event: InteractionEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

  • _onClickLeft2(event: InteractionEvent): void
  • Handle double left-click events which originate from the Canvas stage.

    see

    Canvas._onClickLeft2

    Parameters

    • event: InteractionEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

  • _onDragLeftStart(event: InteractionEvent): Promise<void>
  • Start a left-click drag workflow originating from the Canvas stage.

    see

    Canvas._onDragLeftStart

    Parameters

    • event: InteractionEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns Promise<void>

  • _onDragLeftMove(event: InteractionEvent): void
  • Continue a left-click drag workflow originating from the Canvas stage.

    see

    Canvas._onDragLeftMove

    Parameters

    • event: InteractionEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

  • _onDragLeftDrop(event: InteractionEvent): Promise<void>
  • Conclude a left-click drag workflow originating from the Canvas stage.

    see

    Canvas._onDragLeftDrop

    Parameters

    • event: InteractionEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns Promise<void>

  • _onDragLeftCancel(event: PointerEvent): void
  • Cancel a left-click drag workflow originating from the Canvas stage.

    see

    Canvas._onDragLeftDrop

    Parameters

    • event: PointerEvent

      A right-click pointer event on the document.

    Returns void

  • _onClickRight(event: InteractionEvent): void
  • Handle right mouse-click events which originate from the Canvas stage.

    see

    Canvas._onClickRight

    Parameters

    • event: InteractionEvent

      The PIXI InteractionEvent which wraps a PointerEvent

    Returns void

  • _onMouseWheel(event: WheelEvent): void
  • Handle mouse-wheel events which occur for this active layer.

    see

    MouseManager._onWheel

    Parameters

    • event: WheelEvent

      The WheelEvent initiated on the document

    Returns void

  • _onDeleteKey(event: KeyboardEvent): Promise<void>
  • Handle a DELETE keypress while this layer is active.

    see

    ClientKeybindings._onDelete

    Parameters

    • event: KeyboardEvent

      The delete key press event

    Returns Promise<void>

  • _tearDown(options: any): Promise<void>
  • The inner _tearDown method which may be customized by each CanvasLayer subclass.

    Parameters

    • options: any

    Returns Promise<void>

Properties

zIndex: number
interactive: boolean
interactiveChildren: boolean
hitArea: any
options: { name: string } = ...

Options for this layer instance.

Type declaration

  • name: string
renderable: boolean