diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index 0ebddfc..fd53f2b 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -216,7 +216,7 @@ BitmapText.prototype.updateText = function () { var data = BitmapText.fonts[this._font.name]; - var pos = new core.math.Point(); + var pos = new core.Point(); var prevCharCode = null; var chars = []; var lastLineWidth = 0; @@ -271,7 +271,7 @@ pos.x += charData.kerning[prevCharCode]; } - chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); lastLineWidth = pos.x + (charData.texture.width + charData.xOffset); pos.x += charData.xAdvance; diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index 0ebddfc..fd53f2b 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -216,7 +216,7 @@ BitmapText.prototype.updateText = function () { var data = BitmapText.fonts[this._font.name]; - var pos = new core.math.Point(); + var pos = new core.Point(); var prevCharCode = null; var chars = []; var lastLineWidth = 0; @@ -271,7 +271,7 @@ pos.x += charData.kerning[prevCharCode]; } - chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); lastLineWidth = pos.x + (charData.texture.width + charData.xOffset); pos.x += charData.xAdvance; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 7a37abf..7e72867 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -21,7 +21,7 @@ * * @member {Point} */ - this.tileScale = new core.math.Point(1,1); + this.tileScale = new core.Point(1,1); /** @@ -29,7 +29,7 @@ * * @member {Point} */ - this.tilePosition = new core.math.Point(0,0); + this.tilePosition = new core.Point(0,0); ///// private diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index 0ebddfc..fd53f2b 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -216,7 +216,7 @@ BitmapText.prototype.updateText = function () { var data = BitmapText.fonts[this._font.name]; - var pos = new core.math.Point(); + var pos = new core.Point(); var prevCharCode = null; var chars = []; var lastLineWidth = 0; @@ -271,7 +271,7 @@ pos.x += charData.kerning[prevCharCode]; } - chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); lastLineWidth = pos.x + (charData.texture.width + charData.xOffset); pos.x += charData.xAdvance; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 7a37abf..7e72867 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -21,7 +21,7 @@ * * @member {Point} */ - this.tileScale = new core.math.Point(1,1); + this.tileScale = new core.Point(1,1); /** @@ -29,7 +29,7 @@ * * @member {Point} */ - this.tilePosition = new core.math.Point(0,0); + this.tilePosition = new core.Point(0,0); ///// private diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index fdb9422..6ffb10f 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -14,7 +14,7 @@ */ function DisplacementFilter(sprite) { - var maskMatrix = new core.math.Matrix(); + var maskMatrix = new core.Matrix(); sprite.renderable = false; core.AbstractFilter.call(this, @@ -34,7 +34,7 @@ this.maskMatrix = maskMatrix; - this.scale = new core.math.Point(20,20); + this.scale = new core.Point(20,20); } diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index 0ebddfc..fd53f2b 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -216,7 +216,7 @@ BitmapText.prototype.updateText = function () { var data = BitmapText.fonts[this._font.name]; - var pos = new core.math.Point(); + var pos = new core.Point(); var prevCharCode = null; var chars = []; var lastLineWidth = 0; @@ -271,7 +271,7 @@ pos.x += charData.kerning[prevCharCode]; } - chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); lastLineWidth = pos.x + (charData.texture.width + charData.xOffset); pos.x += charData.xAdvance; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 7a37abf..7e72867 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -21,7 +21,7 @@ * * @member {Point} */ - this.tileScale = new core.math.Point(1,1); + this.tileScale = new core.Point(1,1); /** @@ -29,7 +29,7 @@ * * @member {Point} */ - this.tilePosition = new core.math.Point(0,0); + this.tilePosition = new core.Point(0,0); ///// private diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index fdb9422..6ffb10f 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -14,7 +14,7 @@ */ function DisplacementFilter(sprite) { - var maskMatrix = new core.math.Matrix(); + var maskMatrix = new core.Matrix(); sprite.renderable = false; core.AbstractFilter.call(this, @@ -34,7 +34,7 @@ this.maskMatrix = maskMatrix; - this.scale = new core.math.Point(20,20); + this.scale = new core.Point(20,20); } diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index c83532a..6c3188c 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -51,7 +51,7 @@ a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, id = 1 / (a00 * a11 + a01 * -a10); - point = point || new core.math.Point(); + point = point || new core.Point(); point.x = a11 * id * global.x + -a01 * id * global.x + (a12 * a01 - a02 * a11) * id; point.y = a00 * id * global.y + -a10 * id * global.y + (-a12 * a00 + a02 * a10) * id; diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index 0ebddfc..fd53f2b 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -216,7 +216,7 @@ BitmapText.prototype.updateText = function () { var data = BitmapText.fonts[this._font.name]; - var pos = new core.math.Point(); + var pos = new core.Point(); var prevCharCode = null; var chars = []; var lastLineWidth = 0; @@ -271,7 +271,7 @@ pos.x += charData.kerning[prevCharCode]; } - chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); lastLineWidth = pos.x + (charData.texture.width + charData.xOffset); pos.x += charData.xAdvance; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 7a37abf..7e72867 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -21,7 +21,7 @@ * * @member {Point} */ - this.tileScale = new core.math.Point(1,1); + this.tileScale = new core.Point(1,1); /** @@ -29,7 +29,7 @@ * * @member {Point} */ - this.tilePosition = new core.math.Point(0,0); + this.tilePosition = new core.Point(0,0); ///// private diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index fdb9422..6ffb10f 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -14,7 +14,7 @@ */ function DisplacementFilter(sprite) { - var maskMatrix = new core.math.Matrix(); + var maskMatrix = new core.Matrix(); sprite.renderable = false; core.AbstractFilter.call(this, @@ -34,7 +34,7 @@ this.maskMatrix = maskMatrix; - this.scale = new core.math.Point(20,20); + this.scale = new core.Point(20,20); } diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index c83532a..6c3188c 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -51,7 +51,7 @@ a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, id = 1 / (a00 * a11 + a01 * -a10); - point = point || new core.math.Point(); + point = point || new core.Point(); point.x = a11 * id * global.x + -a01 * id * global.x + (a12 * a01 - a02 * a11) * id; point.y = a00 * id * global.y + -a10 * id * global.y + (-a12 * a00 + a02 * a10) * id; diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index 0d174f9..c6bc554 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -21,7 +21,7 @@ { var charCode = parseInt(letters[i].getAttribute('id'), 10); - var textureRect = new core.math.Rectangle( + var textureRect = new core.Rectangle( parseInt(letters[i].getAttribute('x'), 10) + texture.frame.x, parseInt(letters[i].getAttribute('y'), 10) + texture.frame.y, parseInt(letters[i].getAttribute('width'), 10), diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index 0ebddfc..fd53f2b 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -216,7 +216,7 @@ BitmapText.prototype.updateText = function () { var data = BitmapText.fonts[this._font.name]; - var pos = new core.math.Point(); + var pos = new core.Point(); var prevCharCode = null; var chars = []; var lastLineWidth = 0; @@ -271,7 +271,7 @@ pos.x += charData.kerning[prevCharCode]; } - chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); lastLineWidth = pos.x + (charData.texture.width + charData.xOffset); pos.x += charData.xAdvance; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 7a37abf..7e72867 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -21,7 +21,7 @@ * * @member {Point} */ - this.tileScale = new core.math.Point(1,1); + this.tileScale = new core.Point(1,1); /** @@ -29,7 +29,7 @@ * * @member {Point} */ - this.tilePosition = new core.math.Point(0,0); + this.tilePosition = new core.Point(0,0); ///// private diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index fdb9422..6ffb10f 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -14,7 +14,7 @@ */ function DisplacementFilter(sprite) { - var maskMatrix = new core.math.Matrix(); + var maskMatrix = new core.Matrix(); sprite.renderable = false; core.AbstractFilter.call(this, @@ -34,7 +34,7 @@ this.maskMatrix = maskMatrix; - this.scale = new core.math.Point(20,20); + this.scale = new core.Point(20,20); } diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index c83532a..6c3188c 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -51,7 +51,7 @@ a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, id = 1 / (a00 * a11 + a01 * -a10); - point = point || new core.math.Point(); + point = point || new core.Point(); point.x = a11 * id * global.x + -a01 * id * global.x + (a12 * a01 - a02 * a11) * id; point.y = a00 * id * global.y + -a10 * id * global.y + (-a12 * a00 + a02 * a10) * id; diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index 0d174f9..c6bc554 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -21,7 +21,7 @@ { var charCode = parseInt(letters[i].getAttribute('id'), 10); - var textureRect = new core.math.Rectangle( + var textureRect = new core.Rectangle( parseInt(letters[i].getAttribute('x'), 10) + texture.frame.x, parseInt(letters[i].getAttribute('y'), 10) + texture.frame.y, parseInt(letters[i].getAttribute('width'), 10), diff --git a/src/loaders/spritesheetParser.js b/src/loaders/spritesheetParser.js index 2c57452..f30032c 100644 --- a/src/loaders/spritesheetParser.js +++ b/src/loaders/spritesheetParser.js @@ -38,16 +38,16 @@ var trim = null; if (frames[i].rotated) { - size = new core.math.Rectangle(rect.x, rect.y, rect.h, rect.w); + size = new core.Rectangle(rect.x, rect.y, rect.h, rect.w); } else { - size = new core.math.Rectangle(rect.x, rect.y, rect.w, rect.h); + size = new core.Rectangle(rect.x, rect.y, rect.w, rect.h); } // Check to see if the sprite is trimmed if (frames[i].trimmed) { - trim = new core.math.Rectangle( + trim = new core.Rectangle( frames[i].spriteSourceSize.x / resolution, frames[i].spriteSourceSize.y / resolution, frames[i].sourceSize.w / resolution, diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index 0ebddfc..fd53f2b 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -216,7 +216,7 @@ BitmapText.prototype.updateText = function () { var data = BitmapText.fonts[this._font.name]; - var pos = new core.math.Point(); + var pos = new core.Point(); var prevCharCode = null; var chars = []; var lastLineWidth = 0; @@ -271,7 +271,7 @@ pos.x += charData.kerning[prevCharCode]; } - chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); lastLineWidth = pos.x + (charData.texture.width + charData.xOffset); pos.x += charData.xAdvance; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 7a37abf..7e72867 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -21,7 +21,7 @@ * * @member {Point} */ - this.tileScale = new core.math.Point(1,1); + this.tileScale = new core.Point(1,1); /** @@ -29,7 +29,7 @@ * * @member {Point} */ - this.tilePosition = new core.math.Point(0,0); + this.tilePosition = new core.Point(0,0); ///// private diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index fdb9422..6ffb10f 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -14,7 +14,7 @@ */ function DisplacementFilter(sprite) { - var maskMatrix = new core.math.Matrix(); + var maskMatrix = new core.Matrix(); sprite.renderable = false; core.AbstractFilter.call(this, @@ -34,7 +34,7 @@ this.maskMatrix = maskMatrix; - this.scale = new core.math.Point(20,20); + this.scale = new core.Point(20,20); } diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index c83532a..6c3188c 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -51,7 +51,7 @@ a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, id = 1 / (a00 * a11 + a01 * -a10); - point = point || new core.math.Point(); + point = point || new core.Point(); point.x = a11 * id * global.x + -a01 * id * global.x + (a12 * a01 - a02 * a11) * id; point.y = a00 * id * global.y + -a10 * id * global.y + (-a12 * a00 + a02 * a10) * id; diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index 0d174f9..c6bc554 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -21,7 +21,7 @@ { var charCode = parseInt(letters[i].getAttribute('id'), 10); - var textureRect = new core.math.Rectangle( + var textureRect = new core.Rectangle( parseInt(letters[i].getAttribute('x'), 10) + texture.frame.x, parseInt(letters[i].getAttribute('y'), 10) + texture.frame.y, parseInt(letters[i].getAttribute('width'), 10), diff --git a/src/loaders/spritesheetParser.js b/src/loaders/spritesheetParser.js index 2c57452..f30032c 100644 --- a/src/loaders/spritesheetParser.js +++ b/src/loaders/spritesheetParser.js @@ -38,16 +38,16 @@ var trim = null; if (frames[i].rotated) { - size = new core.math.Rectangle(rect.x, rect.y, rect.h, rect.w); + size = new core.Rectangle(rect.x, rect.y, rect.h, rect.w); } else { - size = new core.math.Rectangle(rect.x, rect.y, rect.w, rect.h); + size = new core.Rectangle(rect.x, rect.y, rect.w, rect.h); } // Check to see if the sprite is trimmed if (frames[i].trimmed) { - trim = new core.math.Rectangle( + trim = new core.Rectangle( frames[i].spriteSourceSize.x / resolution, frames[i].spriteSourceSize.y / resolution, frames[i].sourceSize.w / resolution, diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index 51cc887..596230d 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -397,7 +397,7 @@ if (minX === -Infinity || maxY === Infinity) { - return core.math.Rectangle.EMPTY; + return core.Rectangle.EMPTY; } var bounds = this._bounds; diff --git a/src/core/index.js b/src/core/index.js index 603dfe3..61f003f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -12,7 +12,6 @@ var core = module.exports = Object.assign(require('./const'), require('./math'), { // utils utils: require('./utils'), - math: require('./math'), ticker: require('./ticker'), // display diff --git a/src/core/math/index.js b/src/core/math/index.js index 22d9e87..fd0d9be 100644 --- a/src/core/math/index.js +++ b/src/core/math/index.js @@ -1,4 +1,14 @@ +/** + * Math classes and utilities mixed into PIXI namespace. + * + * @lends PIXI + */ module.exports = { + // These will be mixed to be made publicly available, + // while this module is used internally in core + // to avoid circular dependencies and cut down on + // internal module requires. + Point: require('./Point'), Matrix: require('./Matrix'), diff --git a/src/deprecation.js b/src/deprecation.js index c5f43ca..dc5b544 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -193,6 +193,21 @@ console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); return core.utils.TextureCache; } + }, + + /** + * @namespace + * @private + * @name PIXI.math + * @see {@link PIXI} + * @deprecated since version 3.0.6 + */ + math: { + get: function () + { + console.warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + return core; + } } }); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index 0ebddfc..fd53f2b 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -216,7 +216,7 @@ BitmapText.prototype.updateText = function () { var data = BitmapText.fonts[this._font.name]; - var pos = new core.math.Point(); + var pos = new core.Point(); var prevCharCode = null; var chars = []; var lastLineWidth = 0; @@ -271,7 +271,7 @@ pos.x += charData.kerning[prevCharCode]; } - chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); lastLineWidth = pos.x + (charData.texture.width + charData.xOffset); pos.x += charData.xAdvance; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 7a37abf..7e72867 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -21,7 +21,7 @@ * * @member {Point} */ - this.tileScale = new core.math.Point(1,1); + this.tileScale = new core.Point(1,1); /** @@ -29,7 +29,7 @@ * * @member {Point} */ - this.tilePosition = new core.math.Point(0,0); + this.tilePosition = new core.Point(0,0); ///// private diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index fdb9422..6ffb10f 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -14,7 +14,7 @@ */ function DisplacementFilter(sprite) { - var maskMatrix = new core.math.Matrix(); + var maskMatrix = new core.Matrix(); sprite.renderable = false; core.AbstractFilter.call(this, @@ -34,7 +34,7 @@ this.maskMatrix = maskMatrix; - this.scale = new core.math.Point(20,20); + this.scale = new core.Point(20,20); } diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index c83532a..6c3188c 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -51,7 +51,7 @@ a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, id = 1 / (a00 * a11 + a01 * -a10); - point = point || new core.math.Point(); + point = point || new core.Point(); point.x = a11 * id * global.x + -a01 * id * global.x + (a12 * a01 - a02 * a11) * id; point.y = a00 * id * global.y + -a10 * id * global.y + (-a12 * a00 + a02 * a10) * id; diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index 0d174f9..c6bc554 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -21,7 +21,7 @@ { var charCode = parseInt(letters[i].getAttribute('id'), 10); - var textureRect = new core.math.Rectangle( + var textureRect = new core.Rectangle( parseInt(letters[i].getAttribute('x'), 10) + texture.frame.x, parseInt(letters[i].getAttribute('y'), 10) + texture.frame.y, parseInt(letters[i].getAttribute('width'), 10), diff --git a/src/loaders/spritesheetParser.js b/src/loaders/spritesheetParser.js index 2c57452..f30032c 100644 --- a/src/loaders/spritesheetParser.js +++ b/src/loaders/spritesheetParser.js @@ -38,16 +38,16 @@ var trim = null; if (frames[i].rotated) { - size = new core.math.Rectangle(rect.x, rect.y, rect.h, rect.w); + size = new core.Rectangle(rect.x, rect.y, rect.h, rect.w); } else { - size = new core.math.Rectangle(rect.x, rect.y, rect.w, rect.h); + size = new core.Rectangle(rect.x, rect.y, rect.w, rect.h); } // Check to see if the sprite is trimmed if (frames[i].trimmed) { - trim = new core.math.Rectangle( + trim = new core.Rectangle( frames[i].spriteSourceSize.x / resolution, frames[i].spriteSourceSize.y / resolution, frames[i].sourceSize.w / resolution, diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index 51cc887..596230d 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -397,7 +397,7 @@ if (minX === -Infinity || maxY === Infinity) { - return core.math.Rectangle.EMPTY; + return core.Rectangle.EMPTY; } var bounds = this._bounds; diff --git a/src/mesh/Rope.js b/src/mesh/Rope.js index 8ce30cd..842ae4b 100644 --- a/src/mesh/Rope.js +++ b/src/mesh/Rope.js @@ -85,8 +85,8 @@ var colors = this.colors; var textureUvs = this._texture._uvs; - var offset = new core.math.Point(textureUvs.x0, textureUvs.y0); - var factor = new core.math.Point(textureUvs.x2 - textureUvs.x0, textureUvs.y2 - textureUvs.y0); + var offset = new core.Point(textureUvs.x0, textureUvs.y0); + var factor = new core.Point(textureUvs.x2 - textureUvs.x0, textureUvs.y2 - textureUvs.y0); uvs[0] = 0 + offset.x; uvs[1] = 0 + offset.y;