diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index fd65bfd..0b7d873 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -167,6 +167,16 @@ return baseTexture; }; +/** + * Helper function that returns a base texture based on a canvas element + * If the image is not in the base texture cache it will be created and loaded + * + * @static + * @method fromCanvas + * @param canvas {Canvas} The canvas element source of the texture + * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @return BaseTexture + */ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) { if(!canvas._pixiId) diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index fd65bfd..0b7d873 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -167,6 +167,16 @@ return baseTexture; }; +/** + * Helper function that returns a base texture based on a canvas element + * If the image is not in the base texture cache it will be created and loaded + * + * @static + * @method fromCanvas + * @param canvas {Canvas} The canvas element source of the texture + * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @return BaseTexture + */ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) { if(!canvas._pixiId) diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index c826c07..a603c82 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -155,6 +155,7 @@ * @method fromImage * @param imageUrl {String} The image url of the texture * @param crossorigin {Boolean} Whether requests should be treated as crossorigin + * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts * @return Texture */ PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -193,6 +194,7 @@ * @static * @method fromCanvas * @param canvas {Canvas} The canvas element source of the texture + * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts * @return Texture */ PIXI.Texture.fromCanvas = function(canvas, scaleMode)