dist/melonjs.js
function createPattern(image, repeat) {
         if (!me.Math.isPowerOfTwo(image.width) || !me.Math.isPowerOfTwo(image.height)) {
           var src = typeof image.src !== "undefined" ? image.src : image;
           throw new Error("[WebGL Renderer] " + src + " is not a POT texture " + "(" + image.width + "x" + image.height + ")");
         }

         var texture = new this.Texture(this.Texture.prototype.createAtlas.apply(this.Texture.prototype, [image.width, image.height, "pattern", repeat]), image); // FIXME: Remove old cache entry and texture when changing the repeat mode

         this.compositor.uploadTexture(texture);
         return texture;
       }
function createPattern(image, repeat) {
         if (!me.Math.isPowerOfTwo(image.width) || !me.Math.isPowerOfTwo(image.height)) {
           var src = typeof image.src !== "undefined" ? image.src : image;
           throw new Error("[WebGL Renderer] " + src + " is not a POT texture " + "(" + image.width + "x" + image.height + ")");
         }

         var texture = new this.Texture(this.Texture.prototype.createAtlas.apply(this.Texture.prototype, [image.width, image.height, "pattern", repeat]), image); // FIXME: Remove old cache entry and texture when changing the repeat mode

         this.compositor.uploadTexture(texture);
         return texture;
       }
function createPattern ( image , repeat ) { if ( ! me . Math . isPowerOfTwo ( image . width ) || ! me . Math . isPowerOfTwo ( image . height ) ) { var src = typeof image . src !== "undefined" ? image . src : image ; throw new Error ( "[WebGL Renderer] " + src + " is not a POT texture " + "(" + image . width + "x" + image . height + ")" ) ; } var texture = new this . Texture ( this . Texture . prototype . createAtlas . apply ( this . Texture . prototype , [ image . width , image . height , "pattern" , repeat ] ) , image ) ; // FIXME: Remove old cache entry and texture when changing the repeat mode this . compositor . uploadTexture ( texture ) ; return texture ; }
Create a pattern with the specified repetition
@name createPattern
@memberOf me.WebGLRenderer.prototype
@function
@param {image} image Source image
@param {String} repeat Define how the pattern should be repeated
@return {me.video.renderer.Texture}
@see me.ImageLayer#repeat
@example
var tileable   = renderer.createPattern(image, "repeat");
var horizontal = renderer.createPattern(image, "repeat-x");
var vertical   = renderer.createPattern(image, "repeat-y");
var basic      = renderer.createPattern(image, "no-repeat");
Create a pattern with the specified repetition