Description

Returns a pattern

Usage

Parameters

  • img {String|Image|HTML5CanvasElement|HTML5VideoElement}

    Identifier of the preloaded image, image, video or canvas

  • repeatOption {Sring} optional

    (optional) repeat (default), no-repeat, repeat-x or repeat-y

Example

In method "ready" of the scene :

    var _canvas = this.getCanvas(),
        pattern = _canvas.createPattern("my_img");

    var el = this.createElement();
    el.fillStyle = pattern;
    el.fillRect(0, 0, 100, 100);
    stage.append(el);

Discussion