@pixi/sprite-animated
Advanced tools
Comparing version 5.0.0-alpha.3 to 5.0.0-rc
/*! | ||
* @pixi/sprite-animated - v5.0.0-alpha.3 | ||
* Compiled Tue, 03 Jul 2018 04:08:21 UTC | ||
* @pixi/sprite-animated - v5.0.0-rc | ||
* Compiled Fri, 01 Feb 2019 04:50:10 UTC | ||
* | ||
@@ -13,9 +13,2 @@ * @pixi/sprite-animated is licensed under the MIT License. | ||
/** | ||
* @typedef PIXI.extras.AnimatedSprite~FrameObject | ||
* @type {object} | ||
* @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame | ||
* @property {number} time - the duration of the frame in ms | ||
*/ | ||
/** | ||
* An AnimatedSprite is a simple way to display an animation depicted by a list of textures. | ||
@@ -33,5 +26,18 @@ * | ||
* | ||
* let mc = new PIXI.AnimatedSprite(textureArray); | ||
* let animatedSprite = new PIXI.AnimatedSprite(textureArray); | ||
* ``` | ||
* | ||
* The more efficient and simpler way to create an animated sprite is using a {@link PIXI.Spritesheet} | ||
* containing the animation definitions: | ||
* | ||
* ```js | ||
* PIXI.loader.add("assets/spritesheet.json").load(setup); | ||
* | ||
* function setup() { | ||
* let sheet = PIXI.loader.resources["assets/spritesheet.json"].spritesheet; | ||
* animatedSprite = new PIXI.AnimatedSprite(sheet.animations["image_sequence"]); | ||
* ... | ||
* } | ||
* ``` | ||
* | ||
* @class | ||
@@ -41,3 +47,3 @@ * @extends PIXI.Sprite | ||
*/ | ||
var AnimatedSprite = (function (Sprite$$1) { | ||
var AnimatedSprite = /*@__PURE__*/(function (Sprite$$1) { | ||
function AnimatedSprite(textures, autoUpdate) | ||
@@ -48,2 +54,3 @@ { | ||
/** | ||
* @type {PIXI.Texture[]} | ||
* @private | ||
@@ -54,2 +61,3 @@ */ | ||
/** | ||
* @type {number[]} | ||
* @private | ||
@@ -211,4 +219,2 @@ */ | ||
{ | ||
var this$1 = this; | ||
var elapsed = this.animationSpeed * deltaTime; | ||
@@ -225,4 +231,4 @@ var previousFrame = this.currentFrame; | ||
{ | ||
this$1._currentTime--; | ||
lag += this$1._durations[this$1.currentFrame]; | ||
this._currentTime--; | ||
lag += this._durations[this.currentFrame]; | ||
} | ||
@@ -236,4 +242,4 @@ | ||
{ | ||
lag -= this$1._durations[this$1.currentFrame] * sign; | ||
this$1._currentTime += sign; | ||
lag -= this._durations[this.currentFrame] * sign; | ||
this._currentTime += sign; | ||
} | ||
@@ -293,3 +299,5 @@ | ||
this._textureID = -1; | ||
this._textureTrimmedID = -1; | ||
this.cachedTint = 0xFFFFFF; | ||
this.uvs = this._texture._uvs.uvsFloat32; | ||
@@ -316,2 +324,6 @@ if (this.onFrameChange) | ||
Sprite$$1.prototype.destroy.call(this, options); | ||
this.onComplete = null; | ||
this.onFrameChange = null; | ||
this.onLoop = null; | ||
}; | ||
@@ -382,4 +394,2 @@ | ||
{ | ||
var this$1 = this; | ||
if (value[0] instanceof Texture) | ||
@@ -397,4 +407,4 @@ { | ||
{ | ||
this$1._textures.push(value[i].texture); | ||
this$1._durations.push(value[i].time); | ||
this._textures.push(value[i].texture); | ||
this._durations.push(value[i].time); | ||
} | ||
@@ -429,3 +439,11 @@ } | ||
/** | ||
* @memberof PIXI.AnimatedSprite | ||
* @typedef {object} FrameObject | ||
* @type {object} | ||
* @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame | ||
* @property {number} time - the duration of the frame in ms | ||
*/ | ||
export { AnimatedSprite }; | ||
//# sourceMappingURL=sprite-animated.es.js.map |
/*! | ||
* @pixi/sprite-animated - v5.0.0-alpha.3 | ||
* Compiled Tue, 03 Jul 2018 04:08:21 UTC | ||
* @pixi/sprite-animated - v5.0.0-rc | ||
* Compiled Fri, 01 Feb 2019 04:50:10 UTC | ||
* | ||
@@ -17,9 +17,2 @@ * @pixi/sprite-animated is licensed under the MIT License. | ||
/** | ||
* @typedef PIXI.extras.AnimatedSprite~FrameObject | ||
* @type {object} | ||
* @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame | ||
* @property {number} time - the duration of the frame in ms | ||
*/ | ||
/** | ||
* An AnimatedSprite is a simple way to display an animation depicted by a list of textures. | ||
@@ -37,5 +30,18 @@ * | ||
* | ||
* let mc = new PIXI.AnimatedSprite(textureArray); | ||
* let animatedSprite = new PIXI.AnimatedSprite(textureArray); | ||
* ``` | ||
* | ||
* The more efficient and simpler way to create an animated sprite is using a {@link PIXI.Spritesheet} | ||
* containing the animation definitions: | ||
* | ||
* ```js | ||
* PIXI.loader.add("assets/spritesheet.json").load(setup); | ||
* | ||
* function setup() { | ||
* let sheet = PIXI.loader.resources["assets/spritesheet.json"].spritesheet; | ||
* animatedSprite = new PIXI.AnimatedSprite(sheet.animations["image_sequence"]); | ||
* ... | ||
* } | ||
* ``` | ||
* | ||
* @class | ||
@@ -45,8 +51,9 @@ * @extends PIXI.Sprite | ||
*/ | ||
var AnimatedSprite = (function (Sprite$$1) { | ||
var AnimatedSprite = /*@__PURE__*/(function (Sprite) { | ||
function AnimatedSprite(textures, autoUpdate) | ||
{ | ||
Sprite$$1.call(this, textures[0] instanceof core.Texture ? textures[0] : textures[0].texture); | ||
Sprite.call(this, textures[0] instanceof core.Texture ? textures[0] : textures[0].texture); | ||
/** | ||
* @type {PIXI.Texture[]} | ||
* @private | ||
@@ -57,2 +64,3 @@ */ | ||
/** | ||
* @type {number[]} | ||
* @private | ||
@@ -126,4 +134,4 @@ */ | ||
if ( Sprite$$1 ) AnimatedSprite.__proto__ = Sprite$$1; | ||
AnimatedSprite.prototype = Object.create( Sprite$$1 && Sprite$$1.prototype ); | ||
if ( Sprite ) AnimatedSprite.__proto__ = Sprite; | ||
AnimatedSprite.prototype = Object.create( Sprite && Sprite.prototype ); | ||
AnimatedSprite.prototype.constructor = AnimatedSprite; | ||
@@ -215,4 +223,2 @@ | ||
{ | ||
var this$1 = this; | ||
var elapsed = this.animationSpeed * deltaTime; | ||
@@ -229,4 +235,4 @@ var previousFrame = this.currentFrame; | ||
{ | ||
this$1._currentTime--; | ||
lag += this$1._durations[this$1.currentFrame]; | ||
this._currentTime--; | ||
lag += this._durations[this.currentFrame]; | ||
} | ||
@@ -240,4 +246,4 @@ | ||
{ | ||
lag -= this$1._durations[this$1.currentFrame] * sign; | ||
this$1._currentTime += sign; | ||
lag -= this._durations[this.currentFrame] * sign; | ||
this._currentTime += sign; | ||
} | ||
@@ -297,3 +303,5 @@ | ||
this._textureID = -1; | ||
this._textureTrimmedID = -1; | ||
this.cachedTint = 0xFFFFFF; | ||
this.uvs = this._texture._uvs.uvsFloat32; | ||
@@ -319,3 +327,7 @@ if (this.onFrameChange) | ||
this.stop(); | ||
Sprite$$1.prototype.destroy.call(this, options); | ||
Sprite.prototype.destroy.call(this, options); | ||
this.onComplete = null; | ||
this.onFrameChange = null; | ||
this.onLoop = null; | ||
}; | ||
@@ -386,4 +398,2 @@ | ||
{ | ||
var this$1 = this; | ||
if (value[0] instanceof core.Texture) | ||
@@ -401,4 +411,4 @@ { | ||
{ | ||
this$1._textures.push(value[i].texture); | ||
this$1._durations.push(value[i].time); | ||
this._textures.push(value[i].texture); | ||
this._durations.push(value[i].time); | ||
} | ||
@@ -433,3 +443,11 @@ } | ||
/** | ||
* @memberof PIXI.AnimatedSprite | ||
* @typedef {object} FrameObject | ||
* @type {object} | ||
* @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame | ||
* @property {number} time - the duration of the frame in ms | ||
*/ | ||
exports.AnimatedSprite = AnimatedSprite; | ||
//# sourceMappingURL=sprite-animated.js.map |
{ | ||
"name": "@pixi/sprite-animated", | ||
"version": "5.0.0-alpha.3", | ||
"version": "5.0.0-rc", | ||
"main": "lib/sprite-animated.js", | ||
"module": "lib/sprite-animated.es.js", | ||
"description": "Support for legacy browser JavaScript environments", | ||
"description": "Sprite Animations as depicted by playing a series of Textures", | ||
"author": "Mat Groves", | ||
@@ -28,9 +28,10 @@ "contributors": [ | ||
"dependencies": { | ||
"@pixi/core": "^5.0.0-alpha.3", | ||
"@pixi/sprite": "^5.0.0-alpha.3", | ||
"@pixi/ticker": "^5.0.0-alpha.3" | ||
"@pixi/core": "^5.0.0-rc", | ||
"@pixi/sprite": "^5.0.0-rc", | ||
"@pixi/ticker": "^5.0.0-rc" | ||
}, | ||
"devDependencies": { | ||
"floss": "^2.1.3" | ||
} | ||
"floss": "^2.1.5" | ||
}, | ||
"gitHead": "9026a1bbca9a9d86b7a3b6d5eb4fa2c3145c2b85" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59320
756
Updated@pixi/core@^5.0.0-rc
Updated@pixi/sprite@^5.0.0-rc
Updated@pixi/ticker@^5.0.0-rc