diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 33da9e1..dd50b06 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -3,8 +3,9 @@ */ /** + * Utility methods for Sprite/Texture tinting. + * * @class CanvasTinter - * @constructor * @static */ PIXI.CanvasTinter = function() @@ -15,6 +16,7 @@ * Basically this method just needs a sprite and a color and tints the sprite with the given color. * * @method getTintedTexture + * @static * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -59,6 +61,7 @@ * Tint a texture using the "multiply" operation. * * @method tintWithMultiply + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -105,6 +108,7 @@ * Tint a texture using the "overlay" operation. * * @method tintWithOverlay + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -140,6 +144,7 @@ * Tint a texture pixel per pixel. * * @method tintPerPixel + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -185,6 +190,7 @@ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. * * @method roundColor + * @static * @param color {number} the color to round, should be a hex color */ PIXI.CanvasTinter.roundColor = function(color) @@ -203,8 +209,9 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @property cacheStepsPerColorChannel + * @property cacheStepsPerColorChannel * @type Number + * @static */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; @@ -213,6 +220,7 @@ * * @property convertTintToImage * @type Boolean + * @static */ PIXI.CanvasTinter.convertTintToImage = false; @@ -221,6 +229,7 @@ * * @property canUseMultiply * @type Boolean + * @static */ PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); @@ -228,5 +237,6 @@ * The tinting method that will be used. * * @method tintMethod + * @static */ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 33da9e1..dd50b06 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -3,8 +3,9 @@ */ /** + * Utility methods for Sprite/Texture tinting. + * * @class CanvasTinter - * @constructor * @static */ PIXI.CanvasTinter = function() @@ -15,6 +16,7 @@ * Basically this method just needs a sprite and a color and tints the sprite with the given color. * * @method getTintedTexture + * @static * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -59,6 +61,7 @@ * Tint a texture using the "multiply" operation. * * @method tintWithMultiply + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -105,6 +108,7 @@ * Tint a texture using the "overlay" operation. * * @method tintWithOverlay + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -140,6 +144,7 @@ * Tint a texture pixel per pixel. * * @method tintPerPixel + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -185,6 +190,7 @@ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. * * @method roundColor + * @static * @param color {number} the color to round, should be a hex color */ PIXI.CanvasTinter.roundColor = function(color) @@ -203,8 +209,9 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @property cacheStepsPerColorChannel + * @property cacheStepsPerColorChannel * @type Number + * @static */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; @@ -213,6 +220,7 @@ * * @property convertTintToImage * @type Boolean + * @static */ PIXI.CanvasTinter.convertTintToImage = false; @@ -221,6 +229,7 @@ * * @property canUseMultiply * @type Boolean + * @static */ PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); @@ -228,5 +237,6 @@ * The tinting method that will be used. * * @method tintMethod + * @static */ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/src/pixi/renderers/webgl/utils/FilterTexture.js b/src/pixi/renderers/webgl/utils/FilterTexture.js index 389acbe..0340289 100644 --- a/src/pixi/renderers/webgl/utils/FilterTexture.js +++ b/src/pixi/renderers/webgl/utils/FilterTexture.js @@ -8,7 +8,7 @@ * @param gl {WebGLContext} the current WebGL drawing context * @param width {Number} the horizontal range of the filter * @param height {Number} the vertical range of the filter -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts +* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.FilterTexture = function(gl, width, height, scaleMode) { diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 33da9e1..dd50b06 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -3,8 +3,9 @@ */ /** + * Utility methods for Sprite/Texture tinting. + * * @class CanvasTinter - * @constructor * @static */ PIXI.CanvasTinter = function() @@ -15,6 +16,7 @@ * Basically this method just needs a sprite and a color and tints the sprite with the given color. * * @method getTintedTexture + * @static * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -59,6 +61,7 @@ * Tint a texture using the "multiply" operation. * * @method tintWithMultiply + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -105,6 +108,7 @@ * Tint a texture using the "overlay" operation. * * @method tintWithOverlay + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -140,6 +144,7 @@ * Tint a texture pixel per pixel. * * @method tintPerPixel + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -185,6 +190,7 @@ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. * * @method roundColor + * @static * @param color {number} the color to round, should be a hex color */ PIXI.CanvasTinter.roundColor = function(color) @@ -203,8 +209,9 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @property cacheStepsPerColorChannel + * @property cacheStepsPerColorChannel * @type Number + * @static */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; @@ -213,6 +220,7 @@ * * @property convertTintToImage * @type Boolean + * @static */ PIXI.CanvasTinter.convertTintToImage = false; @@ -221,6 +229,7 @@ * * @property canUseMultiply * @type Boolean + * @static */ PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); @@ -228,5 +237,6 @@ * The tinting method that will be used. * * @method tintMethod + * @static */ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/src/pixi/renderers/webgl/utils/FilterTexture.js b/src/pixi/renderers/webgl/utils/FilterTexture.js index 389acbe..0340289 100644 --- a/src/pixi/renderers/webgl/utils/FilterTexture.js +++ b/src/pixi/renderers/webgl/utils/FilterTexture.js @@ -8,7 +8,7 @@ * @param gl {WebGLContext} the current WebGL drawing context * @param width {Number} the horizontal range of the filter * @param height {Number} the vertical range of the filter -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts +* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.FilterTexture = function(gl, width, height, scaleMode) { diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 6e4d8b3..72ebd00 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -389,7 +389,7 @@ * @param cpY {Number} Control point y * @param toX {Number} Destination point x * @param toY {Number} Destination point y - * @return {Array} + * @return {Array(Number)} */ PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 33da9e1..dd50b06 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -3,8 +3,9 @@ */ /** + * Utility methods for Sprite/Texture tinting. + * * @class CanvasTinter - * @constructor * @static */ PIXI.CanvasTinter = function() @@ -15,6 +16,7 @@ * Basically this method just needs a sprite and a color and tints the sprite with the given color. * * @method getTintedTexture + * @static * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -59,6 +61,7 @@ * Tint a texture using the "multiply" operation. * * @method tintWithMultiply + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -105,6 +108,7 @@ * Tint a texture using the "overlay" operation. * * @method tintWithOverlay + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -140,6 +144,7 @@ * Tint a texture pixel per pixel. * * @method tintPerPixel + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -185,6 +190,7 @@ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. * * @method roundColor + * @static * @param color {number} the color to round, should be a hex color */ PIXI.CanvasTinter.roundColor = function(color) @@ -203,8 +209,9 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @property cacheStepsPerColorChannel + * @property cacheStepsPerColorChannel * @type Number + * @static */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; @@ -213,6 +220,7 @@ * * @property convertTintToImage * @type Boolean + * @static */ PIXI.CanvasTinter.convertTintToImage = false; @@ -221,6 +229,7 @@ * * @property canUseMultiply * @type Boolean + * @static */ PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); @@ -228,5 +237,6 @@ * The tinting method that will be used. * * @method tintMethod + * @static */ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/src/pixi/renderers/webgl/utils/FilterTexture.js b/src/pixi/renderers/webgl/utils/FilterTexture.js index 389acbe..0340289 100644 --- a/src/pixi/renderers/webgl/utils/FilterTexture.js +++ b/src/pixi/renderers/webgl/utils/FilterTexture.js @@ -8,7 +8,7 @@ * @param gl {WebGLContext} the current WebGL drawing context * @param width {Number} the horizontal range of the filter * @param height {Number} the vertical range of the filter -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts +* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.FilterTexture = function(gl, width, height, scaleMode) { diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 6e4d8b3..72ebd00 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -389,7 +389,7 @@ * @param cpY {Number} Control point y * @param toX {Number} Destination point x * @param toY {Number} Destination point y - * @return {Array} + * @return {Array(Number)} */ PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index b991bed..6fb2b25 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -13,7 +13,7 @@ * @uses EventTarget * @constructor * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.BaseTexture = function(source, scaleMode) { @@ -233,7 +233,7 @@ * @method fromImage * @param imageUrl {String} The image url of the texture * @param crossorigin {Boolean} - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -273,7 +273,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 33da9e1..dd50b06 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -3,8 +3,9 @@ */ /** + * Utility methods for Sprite/Texture tinting. + * * @class CanvasTinter - * @constructor * @static */ PIXI.CanvasTinter = function() @@ -15,6 +16,7 @@ * Basically this method just needs a sprite and a color and tints the sprite with the given color. * * @method getTintedTexture + * @static * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -59,6 +61,7 @@ * Tint a texture using the "multiply" operation. * * @method tintWithMultiply + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -105,6 +108,7 @@ * Tint a texture using the "overlay" operation. * * @method tintWithOverlay + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -140,6 +144,7 @@ * Tint a texture pixel per pixel. * * @method tintPerPixel + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -185,6 +190,7 @@ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. * * @method roundColor + * @static * @param color {number} the color to round, should be a hex color */ PIXI.CanvasTinter.roundColor = function(color) @@ -203,8 +209,9 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @property cacheStepsPerColorChannel + * @property cacheStepsPerColorChannel * @type Number + * @static */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; @@ -213,6 +220,7 @@ * * @property convertTintToImage * @type Boolean + * @static */ PIXI.CanvasTinter.convertTintToImage = false; @@ -221,6 +229,7 @@ * * @property canUseMultiply * @type Boolean + * @static */ PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); @@ -228,5 +237,6 @@ * The tinting method that will be used. * * @method tintMethod + * @static */ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/src/pixi/renderers/webgl/utils/FilterTexture.js b/src/pixi/renderers/webgl/utils/FilterTexture.js index 389acbe..0340289 100644 --- a/src/pixi/renderers/webgl/utils/FilterTexture.js +++ b/src/pixi/renderers/webgl/utils/FilterTexture.js @@ -8,7 +8,7 @@ * @param gl {WebGLContext} the current WebGL drawing context * @param width {Number} the horizontal range of the filter * @param height {Number} the vertical range of the filter -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts +* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.FilterTexture = function(gl, width, height, scaleMode) { diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 6e4d8b3..72ebd00 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -389,7 +389,7 @@ * @param cpY {Number} Control point y * @param toX {Number} Destination point x * @param toY {Number} Destination point y - * @return {Array} + * @return {Array(Number)} */ PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index b991bed..6fb2b25 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -13,7 +13,7 @@ * @uses EventTarget * @constructor * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.BaseTexture = function(source, scaleMode) { @@ -233,7 +233,7 @@ * @method fromImage * @param imageUrl {String} The image url of the texture * @param crossorigin {Boolean} - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -273,7 +273,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index bc5c7cb..37dd7c8 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -29,7 +29,7 @@ * @param width {Number} The width of the render texture * @param height {Number} The height of the render texture * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param resolution {Number} The resolution of the texture being generated */ PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 33da9e1..dd50b06 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -3,8 +3,9 @@ */ /** + * Utility methods for Sprite/Texture tinting. + * * @class CanvasTinter - * @constructor * @static */ PIXI.CanvasTinter = function() @@ -15,6 +16,7 @@ * Basically this method just needs a sprite and a color and tints the sprite with the given color. * * @method getTintedTexture + * @static * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -59,6 +61,7 @@ * Tint a texture using the "multiply" operation. * * @method tintWithMultiply + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -105,6 +108,7 @@ * Tint a texture using the "overlay" operation. * * @method tintWithOverlay + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -140,6 +144,7 @@ * Tint a texture pixel per pixel. * * @method tintPerPixel + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -185,6 +190,7 @@ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. * * @method roundColor + * @static * @param color {number} the color to round, should be a hex color */ PIXI.CanvasTinter.roundColor = function(color) @@ -203,8 +209,9 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @property cacheStepsPerColorChannel + * @property cacheStepsPerColorChannel * @type Number + * @static */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; @@ -213,6 +220,7 @@ * * @property convertTintToImage * @type Boolean + * @static */ PIXI.CanvasTinter.convertTintToImage = false; @@ -221,6 +229,7 @@ * * @property canUseMultiply * @type Boolean + * @static */ PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); @@ -228,5 +237,6 @@ * The tinting method that will be used. * * @method tintMethod + * @static */ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/src/pixi/renderers/webgl/utils/FilterTexture.js b/src/pixi/renderers/webgl/utils/FilterTexture.js index 389acbe..0340289 100644 --- a/src/pixi/renderers/webgl/utils/FilterTexture.js +++ b/src/pixi/renderers/webgl/utils/FilterTexture.js @@ -8,7 +8,7 @@ * @param gl {WebGLContext} the current WebGL drawing context * @param width {Number} the horizontal range of the filter * @param height {Number} the vertical range of the filter -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts +* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.FilterTexture = function(gl, width, height, scaleMode) { diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 6e4d8b3..72ebd00 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -389,7 +389,7 @@ * @param cpY {Number} Control point y * @param toX {Number} Destination point x * @param toY {Number} Destination point y - * @return {Array} + * @return {Array(Number)} */ PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index b991bed..6fb2b25 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -13,7 +13,7 @@ * @uses EventTarget * @constructor * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.BaseTexture = function(source, scaleMode) { @@ -233,7 +233,7 @@ * @method fromImage * @param imageUrl {String} The image url of the texture * @param crossorigin {Boolean} - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -273,7 +273,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index bc5c7cb..37dd7c8 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -29,7 +29,7 @@ * @param width {Number} The width of the render texture * @param height {Number} The height of the render texture * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param resolution {Number} The resolution of the texture being generated */ PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index c6820db..6628e57 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -232,7 +232,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return Texture */ PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -270,7 +270,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return Texture */ PIXI.Texture.fromCanvas = function(canvas, scaleMode) diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 33da9e1..dd50b06 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -3,8 +3,9 @@ */ /** + * Utility methods for Sprite/Texture tinting. + * * @class CanvasTinter - * @constructor * @static */ PIXI.CanvasTinter = function() @@ -15,6 +16,7 @@ * Basically this method just needs a sprite and a color and tints the sprite with the given color. * * @method getTintedTexture + * @static * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -59,6 +61,7 @@ * Tint a texture using the "multiply" operation. * * @method tintWithMultiply + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -105,6 +108,7 @@ * Tint a texture using the "overlay" operation. * * @method tintWithOverlay + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -140,6 +144,7 @@ * Tint a texture pixel per pixel. * * @method tintPerPixel + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -185,6 +190,7 @@ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. * * @method roundColor + * @static * @param color {number} the color to round, should be a hex color */ PIXI.CanvasTinter.roundColor = function(color) @@ -203,8 +209,9 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @property cacheStepsPerColorChannel + * @property cacheStepsPerColorChannel * @type Number + * @static */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; @@ -213,6 +220,7 @@ * * @property convertTintToImage * @type Boolean + * @static */ PIXI.CanvasTinter.convertTintToImage = false; @@ -221,6 +229,7 @@ * * @property canUseMultiply * @type Boolean + * @static */ PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); @@ -228,5 +237,6 @@ * The tinting method that will be used. * * @method tintMethod + * @static */ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/src/pixi/renderers/webgl/utils/FilterTexture.js b/src/pixi/renderers/webgl/utils/FilterTexture.js index 389acbe..0340289 100644 --- a/src/pixi/renderers/webgl/utils/FilterTexture.js +++ b/src/pixi/renderers/webgl/utils/FilterTexture.js @@ -8,7 +8,7 @@ * @param gl {WebGLContext} the current WebGL drawing context * @param width {Number} the horizontal range of the filter * @param height {Number} the vertical range of the filter -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts +* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.FilterTexture = function(gl, width, height, scaleMode) { diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 6e4d8b3..72ebd00 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -389,7 +389,7 @@ * @param cpY {Number} Control point y * @param toX {Number} Destination point x * @param toY {Number} Destination point y - * @return {Array} + * @return {Array(Number)} */ PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index b991bed..6fb2b25 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -13,7 +13,7 @@ * @uses EventTarget * @constructor * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.BaseTexture = function(source, scaleMode) { @@ -233,7 +233,7 @@ * @method fromImage * @param imageUrl {String} The image url of the texture * @param crossorigin {Boolean} - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -273,7 +273,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index bc5c7cb..37dd7c8 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -29,7 +29,7 @@ * @param width {Number} The width of the render texture * @param height {Number} The height of the render texture * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param resolution {Number} The resolution of the texture being generated */ PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index c6820db..6628e57 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -232,7 +232,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return Texture */ PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -270,7 +270,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return Texture */ PIXI.Texture.fromCanvas = function(canvas, scaleMode) diff --git a/src/pixi/textures/VideoTexture.js b/src/pixi/textures/VideoTexture.js index aba9700..906ae49 100644 --- a/src/pixi/textures/VideoTexture.js +++ b/src/pixi/textures/VideoTexture.js @@ -1,4 +1,14 @@ - +/** + * A texture of a [playing] Video. + * + * See the ["deus" demo](http://www.goodboydigital.com/pixijs/examples/deus/). + * + * @class VideoTexture + * @extends BaseTexture + * @constructor + * @param source {HTMLVideoElement} + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + */ PIXI.VideoTexture = function( source, scaleMode ) { if( !source ){ @@ -83,12 +93,28 @@ } }; +PIXI.VideoTexture.prototype.destroy = function() +{ + if( this.source && this.source._pixiId ) + { + PIXI.BaseTextureCache[ this.source._pixiId ] = null; + delete PIXI.BaseTextureCache[ this.source._pixiId ]; + + this.source._pixiId = null; + delete this.source._pixiId; + } + + PIXI.BaseTexture.prototype.destroy.call( this ); +}; /** * Mimic Pixi BaseTexture.from.... method. - * @param video - * @param scaleMode - * @returns {PIXI.VideoTexture} + * + * @static + * @method baseTextureFromVideo + * @param video {HTMLVideoElement} + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @returns {VideoTexture} */ PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode ) { @@ -108,26 +134,14 @@ return baseTexture; }; - -PIXI.VideoTexture.prototype.destroy = function() -{ - if( this.source && this.source._pixiId ) - { - PIXI.BaseTextureCache[ this.source._pixiId ] = null; - delete PIXI.BaseTextureCache[ this.source._pixiId ]; - - this.source._pixiId = null; - delete this.source._pixiId; - } - - PIXI.BaseTexture.prototype.destroy.call( this ); -}; - /** - * Mimic PIXI Texture.from... method. - * @param video - * @param scaleMode - * @returns {PIXI.Texture} + * Mimic Pixi BaseTexture.from.... method. + * + * @static + * @method textureFromVideo + * @param video {HTMLVideoElement} + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @returns {Texture} A Texture, but not a VideoTexture. */ PIXI.VideoTexture.textureFromVideo = function( video, scaleMode ) { @@ -135,6 +149,15 @@ return new PIXI.Texture( baseTexture ); }; +/** + * Mimic Pixi BaseTexture.from.... method. + * + * @static + * @method fromUrl + * @param videoSrc {String} The URL for the video. + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @returns {VideoTexture} + */ PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode ) { var video = document.createElement('video'); @@ -143,4 +166,3 @@ video.play(); return PIXI.VideoTexture.textureFromVideo( video, scaleMode); }; - diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 2672346..4e259a6 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,23 +3,63 @@ */ /** + * The [pixi.js](http://www.pixijs.com/) module/namespace. + * * @module PIXI */ + +/** + * Namespace-class for [pixi.js](http://www.pixijs.com/). + * + * Contains assorted static properties and enumerations. + * + * @class PIXI + * @static + */ var PIXI = PIXI || {}; -/* -* -* This file contains a lot of pixi consts which are used across the rendering engine -* @class Consts -*/ +/** + * @property {Number} WEBGL_RENDERER + * @protected + * @static + */ PIXI.WEBGL_RENDERER = 0; +/** + * @property {Number} CANVAS_RENDERER + * @protected + * @static + */ PIXI.CANVAS_RENDERER = 1; -// useful for testing against if your lib is using pixi. +/** + * Version of pixi that is loaded. + * @property {String} VERSION + * @static + */ PIXI.VERSION = "v2.1.0"; - -// the various blend modes supported by pixi +/** + * Various blend modes supported by pixi. + * @property {Object} blendModes + * @property {Number} blendModes.NORMAL + * @property {Number} blendModes.ADD + * @property {Number} blendModes.MULTIPLY + * @property {Number} blendModes.SCREEN + * @property {Number} blendModes.OVERLAY + * @property {Number} blendModes.DARKEN + * @property {Number} blendModes.LIGHTEN + * @property {Number} blendModes.COLOR_DODGE + * @property {Number} blendModes.COLOR_BURN + * @property {Number} blendModes.HARD_LIGHT + * @property {Number} blendModes.SOFT_LIGHT + * @property {Number} blendModes.DIFFERENCE + * @property {Number} blendModes.EXCLUSION + * @property {Number} blendModes.HUE + * @property {Number} blendModes.SATURATION + * @property {Number} blendModes.COLOR + * @property {Number} blendModes.LUMINOSITY + * @static + */ PIXI.blendModes = { NORMAL:0, ADD:1, @@ -40,7 +80,18 @@ LUMINOSITY:16 }; -// the scale modes +/** + * The scale modes that are supported by pixi. + * + * The DEFAULT scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @property {Object} scaleModes + * @property {Number} scaleModes.DEFAULT=LINEAR + * @property {Number} scaleModes.LINEAR Smooth scaling + * @property {Number} scaleModes.NEAREST Pixelating scaling + * @static + */ PIXI.scaleModes = { DEFAULT:0, LINEAR:0, @@ -65,19 +116,58 @@ PIXI.INTERACTION_FREQUENCY = 30; PIXI.AUTO_PREVENT_DEFAULT = true; +/** + * @property {Number} PI_2 + * @static + */ PIXI.PI_2 = Math.PI * 2; + +/** + * @property {Number} RAD_TO_DEG + * @static + */ PIXI.RAD_TO_DEG = 180 / Math.PI; + +/** + * @property {Number} DEG_TO_RAD + * @static + */ PIXI.DEG_TO_RAD = Math.PI / 180; +/** + * @property {String} RETINA_PREFIX + * @protected + * @static + */ PIXI.RETINA_PREFIX = "@2x"; //PIXI.SCALE_PREFIX "@x%%"; +/** + * If true the default pixi startup (console) banner message will be suppressed. + * + * @property {Boolean} dontSayHello + * @default false + * @static + */ PIXI.dontSayHello = false; - +/** + * The default render options if none are supplied to + * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. + * + * @property {Object} defaultRenderOptions + * @property {Object} defaultRenderOptions.view=null + * @property {Boolean} defaultRenderOptions.transparent=false + * @property {Boolean} defaultRenderOptions.antialias=false + * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false + * @property {Number} defaultRenderOptions.resolution=1 + * @property {Boolean} defaultRenderOptions.clearBeforeRender=true + * @property {Boolean} defaultRenderOptions.autoResize=false + * @static + */ PIXI.defaultRenderOptions = { - view:null, - transparent:false, + view:null, + transparent:false, antialias:false, preserveDrawingBuffer:false, resolution:1, @@ -104,8 +194,6 @@ 'color: #ff2424; background: #fff' ]; - - console.log.apply(console, args); } else if (window['console']) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 5f83192..6c85ac0 100755 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -383,7 +383,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * @property filters - * @type Array An array of filters + * @type {Array(Filter)} */ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { @@ -562,7 +562,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. * @return {Texture} a texture of the graphics object */ diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 99b4fda..e3ccc20 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -18,7 +18,7 @@ * [read-only] The array of children of this container. * * @property children - * @type Array + * @type Array(DisplayObject) * @readOnly */ this.children = []; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 05b51b8..e07df82 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -8,7 +8,7 @@ * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array(Texture)} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { diff --git a/src/pixi/filters/AbstractFilter.js b/src/pixi/filters/AbstractFilter.js index 0d5c16d..6727dc5 100644 --- a/src/pixi/filters/AbstractFilter.js +++ b/src/pixi/filters/AbstractFilter.js @@ -16,14 +16,14 @@ * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. * For example the blur filter has two passes blurX and blurY. * @property passes - * @type Array an array of filter objects + * @type Array(Filter) * @private */ this.passes = [this]; /** * @property shaders - * @type Array an array of shaders + * @type Array(Shader) * @private */ this.shaders = []; diff --git a/src/pixi/filters/ColorMatrixFilter.js b/src/pixi/filters/ColorMatrixFilter.js index 771d6eb..8f1dcbe 100644 --- a/src/pixi/filters/ColorMatrixFilter.js +++ b/src/pixi/filters/ColorMatrixFilter.js @@ -47,7 +47,7 @@ * Sets the matrix of the color matrix filter * * @property matrix - * @type Array and array of 26 numbers + * @type Array(Number) * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] */ Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d47c8a8..d615a89 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -5,7 +5,7 @@ /** * @class Polygon * @constructor - * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index a89e5d8..25adce2 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -12,7 +12,7 @@ * @class AssetLoader * @constructor * @uses EventTarget - * @param assetURLs {Array} An array of image/sprite sheet urls that you would like loaded + * @param assetURLs {Array(String)} An array of image/sprite sheet urls that you would like loaded * supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported * sprite sheet data formats only include 'JSON' at this time. Supported bitmap font * data formats include 'xml' and 'fnt'. @@ -24,7 +24,7 @@ * The array of asset URLs that are going to be loaded * * @property assetURLs - * @type Array + * @type Array(String) */ this.assetURLs = assetURLs; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 4e0744f..948e351 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -638,7 +638,7 @@ * * @method generateTexture * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return {Texture} a texture of the graphics object */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 33da9e1..dd50b06 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -3,8 +3,9 @@ */ /** + * Utility methods for Sprite/Texture tinting. + * * @class CanvasTinter - * @constructor * @static */ PIXI.CanvasTinter = function() @@ -15,6 +16,7 @@ * Basically this method just needs a sprite and a color and tints the sprite with the given color. * * @method getTintedTexture + * @static * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -59,6 +61,7 @@ * Tint a texture using the "multiply" operation. * * @method tintWithMultiply + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -105,6 +108,7 @@ * Tint a texture using the "overlay" operation. * * @method tintWithOverlay + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -140,6 +144,7 @@ * Tint a texture pixel per pixel. * * @method tintPerPixel + * @static * @param texture {Texture} the texture to tint * @param color {Number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -185,6 +190,7 @@ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. * * @method roundColor + * @static * @param color {number} the color to round, should be a hex color */ PIXI.CanvasTinter.roundColor = function(color) @@ -203,8 +209,9 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @property cacheStepsPerColorChannel + * @property cacheStepsPerColorChannel * @type Number + * @static */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; @@ -213,6 +220,7 @@ * * @property convertTintToImage * @type Boolean + * @static */ PIXI.CanvasTinter.convertTintToImage = false; @@ -221,6 +229,7 @@ * * @property canUseMultiply * @type Boolean + * @static */ PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); @@ -228,5 +237,6 @@ * The tinting method that will be used. * * @method tintMethod + * @static */ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/src/pixi/renderers/webgl/utils/FilterTexture.js b/src/pixi/renderers/webgl/utils/FilterTexture.js index 389acbe..0340289 100644 --- a/src/pixi/renderers/webgl/utils/FilterTexture.js +++ b/src/pixi/renderers/webgl/utils/FilterTexture.js @@ -8,7 +8,7 @@ * @param gl {WebGLContext} the current WebGL drawing context * @param width {Number} the horizontal range of the filter * @param height {Number} the vertical range of the filter -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts +* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.FilterTexture = function(gl, width, height, scaleMode) { diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 6e4d8b3..72ebd00 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -389,7 +389,7 @@ * @param cpY {Number} Control point y * @param toX {Number} Destination point x * @param toY {Number} Destination point y - * @return {Array} + * @return {Array(Number)} */ PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index b991bed..6fb2b25 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -13,7 +13,7 @@ * @uses EventTarget * @constructor * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values */ PIXI.BaseTexture = function(source, scaleMode) { @@ -233,7 +233,7 @@ * @method fromImage * @param imageUrl {String} The image url of the texture * @param crossorigin {Boolean} - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -273,7 +273,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return BaseTexture */ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index bc5c7cb..37dd7c8 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -29,7 +29,7 @@ * @param width {Number} The width of the render texture * @param height {Number} The height of the render texture * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @param resolution {Number} The resolution of the texture being generated */ PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index c6820db..6628e57 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -232,7 +232,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return Texture */ PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) @@ -270,7 +270,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 + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values * @return Texture */ PIXI.Texture.fromCanvas = function(canvas, scaleMode) diff --git a/src/pixi/textures/VideoTexture.js b/src/pixi/textures/VideoTexture.js index aba9700..906ae49 100644 --- a/src/pixi/textures/VideoTexture.js +++ b/src/pixi/textures/VideoTexture.js @@ -1,4 +1,14 @@ - +/** + * A texture of a [playing] Video. + * + * See the ["deus" demo](http://www.goodboydigital.com/pixijs/examples/deus/). + * + * @class VideoTexture + * @extends BaseTexture + * @constructor + * @param source {HTMLVideoElement} + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + */ PIXI.VideoTexture = function( source, scaleMode ) { if( !source ){ @@ -83,12 +93,28 @@ } }; +PIXI.VideoTexture.prototype.destroy = function() +{ + if( this.source && this.source._pixiId ) + { + PIXI.BaseTextureCache[ this.source._pixiId ] = null; + delete PIXI.BaseTextureCache[ this.source._pixiId ]; + + this.source._pixiId = null; + delete this.source._pixiId; + } + + PIXI.BaseTexture.prototype.destroy.call( this ); +}; /** * Mimic Pixi BaseTexture.from.... method. - * @param video - * @param scaleMode - * @returns {PIXI.VideoTexture} + * + * @static + * @method baseTextureFromVideo + * @param video {HTMLVideoElement} + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @returns {VideoTexture} */ PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode ) { @@ -108,26 +134,14 @@ return baseTexture; }; - -PIXI.VideoTexture.prototype.destroy = function() -{ - if( this.source && this.source._pixiId ) - { - PIXI.BaseTextureCache[ this.source._pixiId ] = null; - delete PIXI.BaseTextureCache[ this.source._pixiId ]; - - this.source._pixiId = null; - delete this.source._pixiId; - } - - PIXI.BaseTexture.prototype.destroy.call( this ); -}; - /** - * Mimic PIXI Texture.from... method. - * @param video - * @param scaleMode - * @returns {PIXI.Texture} + * Mimic Pixi BaseTexture.from.... method. + * + * @static + * @method textureFromVideo + * @param video {HTMLVideoElement} + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @returns {Texture} A Texture, but not a VideoTexture. */ PIXI.VideoTexture.textureFromVideo = function( video, scaleMode ) { @@ -135,6 +149,15 @@ return new PIXI.Texture( baseTexture ); }; +/** + * Mimic Pixi BaseTexture.from.... method. + * + * @static + * @method fromUrl + * @param videoSrc {String} The URL for the video. + * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @returns {VideoTexture} + */ PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode ) { var video = document.createElement('video'); @@ -143,4 +166,3 @@ video.play(); return PIXI.VideoTexture.textureFromVideo( video, scaleMode); }; - diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index 33a97a9..fe38f04 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -6,7 +6,9 @@ * This helper function will automatically detect which renderer you should be using. * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by * the browser then this function will return a canvas renderer - * @class autoDetectRenderer + * + * @method autoDetectRenderer + * @for PIXI * @static * @param width=800 {Number} the width of the renderers view * @param height=600 {Number} the height of the renderers view @@ -47,7 +49,8 @@ * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. * This function will likely change and update as webGL performance improves on these devices. * - * @class autoDetectRecommendedRenderer + * @method autoDetectRecommendedRenderer + * @for PIXI * @static * @param width=800 {Number} the width of the renderers view * @param height=600 {Number} the height of the renderers view