Class Pattern

See

Hierarchy

  • Pattern

Constructors

Properties

crossOrigin: TCrossOrigin = ''

Default


excludeFromExport?: boolean

If true, this object will not be exported during the serialization of a canvas

id: number

ID used for SVG export functionalities

offsetX: number = 0

Pattern horizontal offset from object's left/top corner

Default


offsetY: number = 0

Pattern vertical offset from object's left/top corner

Default


patternTransform: null | TMat2D = null

transform matrix to change the pattern, imported from svgs.

Todo

verify if using the identity matrix as default makes the rest of the code more easy

Default


repeat: PatternRepeat = 'repeat'

Defaults

source: CanvasImageSource

The actual pixel source of the pattern

type: string = 'Pattern'

Accessors

  • get type(): string
  • Legacy identifier of the class. Prefer using this.constructor.type 'Pattern' or utils like isPattern, or instance of to indentify a pattern in your code. Will be removed in future versiones

    Returns string

    TODO

    add sustainable warning message

    Deprecated

  • set type(value): void
  • Parameters

    • value: string

    Returns void

Methods

  • Returns this is {
        source: HTMLCanvasElement;
    }

    true if source is a element

  • Returns this is {
        source: HTMLImageElement;
    }

    true if source is an element

  • Returns an instance of CanvasPattern

    Parameters

    • ctx: CanvasRenderingContext2D

      Context to create pattern

    Returns null | CanvasPattern

  • Returns object representation of a pattern

    Parameters

    • Optional propertiesToInclude: string[] = []

      Any properties that you might want to additionally include in the output

    Returns Record<string, any>

    Object representation of a pattern instance

  • Returns SVG representation of a pattern

    Parameters

    • __namedParameters: TSize

    Returns string

Generated using TypeDoc