diff --git a/src/deprecation.js b/src/deprecation.js index 8de3ed0..6f4bf98 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -1,7 +1,8 @@ /*global console */ -var core = require('./core'), - mesh = require('./mesh'), - extras = require('./extras'); +var core = require('./core'), + mesh = require('./mesh'), + extras = require('./extras'), + utils = require('./core/utils'); /** * @class @@ -9,8 +10,7 @@ * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. */ -core.SpriteBatch = function () -{ +core.SpriteBatch = function() { throw new ReferenceError('SpriteBatch does not exist any more, please use the new ParticleContainer instead.'); }; @@ -18,10 +18,10 @@ * @class * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} - * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.Loader class. + * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. */ -core.AssetLoader = function () { - throw new ReferenceError('The loader system was overhauled in pixi v3, please see the new PIXI.Loader class.'); +core.AssetLoader = function() { + throw new ReferenceError('The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.'); }; Object.defineProperties(core, { @@ -33,8 +33,7 @@ * @deprecated since version 3.0 */ Stage: { - get: function () - { + get: function() { console.warn('You do not need to use a PIXI Stage any more, you can simply render any container.'); return core.Container; } @@ -47,8 +46,7 @@ * @deprecated since version 3.0 */ DisplayObjectContainer: { - get: function () - { + get: function() { console.warn('DisplayObjectContainer has been shortened to Container, please use Container from now on.'); return core.Container; } @@ -61,11 +59,59 @@ * @deprecated since version 3.0 */ Strip: { - get: function () - { + get: function() { console.warn('The Strip class has been renamed to Mesh, please use Mesh from now on.'); return mesh.Mesh; } + }, + + /** + * @class + * @name PIXI.MovieClip + * @see {@link PIXI.MovieClip} + * @deprecated since version 3.0 + */ + MovieClip: { + get: function() { + console.warn('The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on.'); + return extras.MovieClip; + } + }, + /** + * @class + * @name PIXI.TilingSprite + * @see {@link PIXI.TilingSprite} + * @deprecated since version 3.0 + */ + TilingSprite: { + get: function() { + console.warn('The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on.'); + return extras.TilingSprite; + } + }, + /** + * @class + * @name PIXI.TextureCache + * @see {@link PIXI.utils.TextureCache} + * @deprecated since version 3.0 + */ + TextureCache: { + get: function() { + console.warn('The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on.'); + return utils.TextureCache; + } + }, + /** + * @class + * @name PIXI.BitmapText + * @see {@link PIXI.extras.BitmapText} + * @deprecated since version 3.0 + */ + BitmapText: { + get: function() { + console.warn('The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on.'); + return extras.BitmapText; + } } }); @@ -76,8 +122,7 @@ * @see {@link PIXI.Sprite#texture} * @deprecated since version 3.0 */ -core.Sprite.prototype.setTexture = function (texture) -{ +core.Sprite.prototype.setTexture = function(texture) { this.texture = texture; console.warn('setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;'); }; @@ -88,8 +133,7 @@ * @see {@link PIXI.BitmapText#text} * @deprecated since version 3.0 */ -extras.BitmapText.prototype.setText = function (text) -{ +extras.BitmapText.prototype.setText = function(text) { this.text = text; console.warn('setText is now deprecated, please use the text property, e.g : myBitmapText.text = \'my text\';'); }; @@ -100,8 +144,18 @@ * @see {@link PIXI.Text#text} * @deprecated since version 3.0 */ -core.Text.prototype.setText = function (text) -{ +core.Text.prototype.setText = function(text) { this.text = text; console.warn('setText is now deprecated, please use the text property, e.g : myText.text = \'my text\';'); }; + +/** + * @method + * @name PIXI.Texture#setFrame + * @see {@link PIXI.Texture#setFrame} + * @deprecated since version 3.0 + */ +core.Texture.prototype.setFrame = function(frame) { + this.frame = frame; + console.warn('setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;'); +};