Added doc for BaseTexture.fromCanvas

This commit is contained in:
Jeena Paradies 2014-03-08 01:15:14 +01:00
parent ad7ced5407
commit e1f8766a71

View file

@ -167,6 +167,16 @@ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
return baseTexture; 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) PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
{ {
if(!canvas._pixiId) if(!canvas._pixiId)