Class Pattern

const { LazyCanvas, Pattern, SquareLayer } = require('@hitomihiumi/lazy-canvas')

let pattern = new Pattern()
.setPattern('https://i.pinimg.com/1200x/f3/32/19/f332192b2090f437ca9f49c1002287b6.jpg')
.setType('repeat')

let square = new SquareLayer()
.setX(20)
.setY(20)
.setWidth(460)
.setColor(pattern)

const lazy = new LazyCanvas()
.addLayers(square)
//...

Constructors

Properties

Methods

Constructors

Properties

Methods

  • Parameters

    • patternType:
          | "repeat"
          | "repeat-x"
          | "repeat-y"
          | "no-repeat"

    Returns Pattern

  • Returns {
        pattern: {
            data: string | LazyCanvas;
            type: string;
        };
        patternType:
            | "repeat"
            | "repeat-x"
            | "repeat-y"
            | "no-repeat";
        type: string;
        toJSON(): LazyCanvasPattern;
    }