Skip to content
  1. API
  2. Types

CanvasLayer

Type: object

The layer object containing its properties (overloaded for handling canvas).

Properties

  • destroy () => CanvasLayer Destroy the layer (remove it from the layer array, remove its listeners).
  • element HTMLElement HTML element used by the layer.
  • getLevel () => number Retrieves the index of the layer in the layer array.
  • getOpacity () => number Get the layer opacity, between 0 and 1.
  • hide () => CanvasLayer Keep the layer in the layer array but hide its content.
  • isHidden () => boolean Check the layer visibility.
  • moveDown () => CanvasLayer Take the layer down a notch (decreases its index by 1).
  • moveTo (depth: number) => CanvasLayer Move the layer to the specified index in the layer array.
  • moveToBottom () => CanvasLayer Move the layer at the very bottom of the array (index 0).
  • moveToTop () => CanvasLayer Move the layer at the very top of the array (index length - 1).
  • moveUp () => CanvasLayer Take the layer up a notch (increases its index by 1).
  • refresh DrawingFunction Function rerendering the canvas.
  • setOpacity (opacity: number) => CanvasLayer Set the layer opacity.
  • show () => CanvasLayer Show the layer content.