Represents a boat layer with different scale and flip.

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

  • Constructor for the Boat class.

    Parameters

    • xOffset: number

      The x-coordinate offset for the boat.

    • yOffset: number

      The y-coordinate offset for the boat.

    • width: number

      The width of the boat.

    • Optional scale: number

      The scale of the boat.

    • Optional flip: boolean = DEFAULT_FLIP

      Whether to flip the boat horizontally.

    Returns BoatLayer

Properties

elements: Element[] = []

An array of Elements.

range: Range = ...

The tag for the layer.

x: number = 0

The x-coordinate.

y: number = 0

The y-coordinate.

Methods

  • Adds an object at the beginning of elements array. This way object will be rendered first, thus being a background.

    Parameters

    Returns void

  • Renders the layer asynchronously using a web worker.

    Parameters

    • frameNum: number

      The frame number.

    • layerNum: number

      The layer number.

    Returns Promise<string>

    A promise that resolves to the rendered layer as an SVG string.