New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/sprite-animated

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/sprite-animated - npm Package Compare versions

Comparing version 5.2.1 to 5.2.2

99

dist/sprite-animated.js
/*!
* @pixi/sprite-animated - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
* @pixi/sprite-animated - v5.2.2
* Compiled Tue, 21 Apr 2020 03:53:51 UTC
*

@@ -62,6 +62,5 @@ * @pixi/sprite-animated is licensed under the MIT License.

this.textures = textures;
/**
* `true` uses PIXI.Ticker.shared to auto update animation time.
*
* @type {boolean}

@@ -74,2 +73,11 @@ * @default true

/**
* `true` if the instance is currently connected to PIXI.Ticker.shared to auto update animation time.
*
* @type {boolean}
* @default false
* @private
*/
this._isConnectedToTicker = false;
/**
* The speed that the AnimatedSprite will play at. Higher is faster, lower is slower.

@@ -133,9 +141,13 @@ *

this._playing = false;
/**
* Indicates if the AnimatedSprite is currently playing.
* The texture index that was displayed last time
*
* @member {boolean}
* @readonly
* @member {number}
* @private
*/
this.playing = false;
this._previousFrame = null;
this.textures = textures;
}

@@ -147,3 +159,3 @@

var prototypeAccessors = { totalFrames: { configurable: true },textures: { configurable: true },currentFrame: { configurable: true } };
var prototypeAccessors = { totalFrames: { configurable: true },textures: { configurable: true },currentFrame: { configurable: true },playing: { configurable: true },autoUpdate: { configurable: true } };

@@ -161,6 +173,7 @@ /**

this.playing = false;
if (this._autoUpdate)
this._playing = false;
if (this._autoUpdate && this._isConnectedToTicker)
{
ticker.Ticker.shared.remove(this.update, this);
this._isConnectedToTicker = false;
}

@@ -180,6 +193,7 @@ };

this.playing = true;
if (this._autoUpdate)
this._playing = true;
if (this._autoUpdate && !this._isConnectedToTicker)
{
ticker.Ticker.shared.add(this.update, this, ticker.UPDATE_PRIORITY.HIGH);
this._isConnectedToTicker = true;
}

@@ -229,3 +243,2 @@ };

*
* @private
* @param {number} deltaTime - Time since last tick.

@@ -269,4 +282,3 @@ */

{
this._currentTime = 0;
this.stop();
this.gotoAndStop(0);

@@ -280,4 +292,3 @@ if (this.onComplete)

{
this._currentTime = this._textures.length - 1;
this.stop();
this.gotoAndStop(this._textures.length - 1);

@@ -314,3 +325,12 @@ if (this.onComplete)

{
this._texture = this._textures[this.currentFrame];
var currentFrame = this.currentFrame;
if (this._previousFrame === currentFrame)
{
return;
}
this._previousFrame = currentFrame;
this._texture = this._textures[currentFrame];
this._textureID = -1;

@@ -431,2 +451,3 @@ this._textureTrimmedID = -1;

}
this._previousFrame = null;
this.gotoAndStop(0);

@@ -454,2 +475,42 @@ this.updateTexture();

/**
* Indicates if the AnimatedSprite is currently playing.
*
* @member {boolean}
* @readonly
*/
prototypeAccessors.playing.get = function ()
{
return this._playing;
};
/**
* Whether to use PIXI.Ticker.shared to auto update animation time
*
* @member {boolean}
*/
prototypeAccessors.autoUpdate.get = function ()
{
return this._autoUpdate;
};
prototypeAccessors.autoUpdate.set = function (value) // eslint-disable-line require-jsdoc
{
if (value !== this._autoUpdate)
{
this._autoUpdate = value;
if (!this._autoUpdate && this._isConnectedToTicker)
{
ticker.Ticker.shared.remove(this.update, this);
this._isConnectedToTicker = false;
}
else if (this._autoUpdate && !this._isConnectedToTicker && this._playing)
{
ticker.Ticker.shared.add(this.update, this);
this._isConnectedToTicker = true;
}
}
};
Object.defineProperties( AnimatedSprite.prototype, prototypeAccessors );

@@ -456,0 +517,0 @@

6

dist/sprite-animated.min.js
/*!
* @pixi/sprite-animated - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
* @pixi/sprite-animated - v5.2.2
* Compiled Tue, 21 Apr 2020 03:53:51 UTC
*

@@ -8,3 +8,3 @@ * @pixi/sprite-animated is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_sprite_animated=function(t,e,r,i){"use strict";var s=function(t){function r(r,i){t.call(this,r[0]instanceof e.Texture?r[0]:r[0].texture),this._textures=null,this._durations=null,this.textures=r,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var s={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return r.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&i.Ticker.shared.remove(this.update,this))},r.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&i.Ticker.shared.add(this.update,this,i.UPDATE_PRIORITY.HIGH))},r.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},r.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},r.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var s=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this._currentTime=0,this.stop(),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this._currentTime=this._textures.length-1,this.stop(),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<r?this.onLoop():this.animationSpeed<0&&this.currentFrame>r&&this.onLoop()),this.updateTexture())},r.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},r.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},r.fromFrames=function(t){for(var i=[],s=0;s<t.length;++s)i.push(e.Texture.from(t[s]));return new r(i)},r.fromImages=function(t){for(var i=[],s=0;s<t.length;++s)i.push(e.Texture.from(t[s]));return new r(i)},s.totalFrames.get=function(){return this._textures.length},s.textures.get=function(){return this._textures},s.textures.set=function(t){if(t[0]instanceof e.Texture)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var r=0;r<t.length;r++)this._textures.push(t[r].texture),this._durations.push(t[r].time)}this.gotoAndStop(0),this.updateTexture()},s.currentFrame.get=function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},Object.defineProperties(r.prototype,s),r}(r.Sprite);return t.AnimatedSprite=s,t}({},PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_sprite_animated);
this.PIXI=this.PIXI||{};var _pixi_sprite_animated=function(t,e,i,r){"use strict";var s=function(t){function i(i,r){t.call(this,i[0]instanceof e.Texture?i[0]:i[0].texture),this._textures=null,this._durations=null,this._autoUpdate=!1!==r,this._isConnectedToTicker=!1,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=i}t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i;var s={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0},playing:{configurable:!0},autoUpdate:{configurable:!0}};return i.prototype.stop=function(){this.playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(r.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1))},i.prototype.play=function(){this.playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(r.Ticker.shared.add(this.update,this,r.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))},i.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},i.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var s=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i?this.onLoop():this.animationSpeed<0&&this.currentFrame>i&&this.onLoop()),this.updateTexture())},i.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},i.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},i.fromFrames=function(t){for(var r=[],s=0;s<t.length;++s)r.push(e.Texture.from(t[s]));return new i(r)},i.fromImages=function(t){for(var r=[],s=0;s<t.length;++s)r.push(e.Texture.from(t[s]));return new i(r)},s.totalFrames.get=function(){return this._textures.length},s.textures.get=function(){return this._textures},s.textures.set=function(t){if(t[0]instanceof e.Texture)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var i=0;i<t.length;i++)this._textures.push(t[i].texture),this._durations.push(t[i].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},s.currentFrame.get=function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},s.playing.get=function(){return this._playing},s.autoUpdate.get=function(){return this._autoUpdate},s.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(r.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(r.Ticker.shared.add(this.update,this),this._isConnectedToTicker=!0))},Object.defineProperties(i.prototype,s),i}(i.Sprite);return t.AnimatedSprite=s,t}({},PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_sprite_animated);
//# sourceMappingURL=sprite-animated.min.js.map
/*!
* @pixi/sprite-animated - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
* @pixi/sprite-animated - v5.2.2
* Compiled Tue, 21 Apr 2020 03:53:51 UTC
*

@@ -62,6 +62,5 @@ * @pixi/sprite-animated is licensed under the MIT License.

this.textures = textures;
/**
* `true` uses PIXI.Ticker.shared to auto update animation time.
*
* @type {boolean}

@@ -74,2 +73,11 @@ * @default true

/**
* `true` if the instance is currently connected to PIXI.Ticker.shared to auto update animation time.
*
* @type {boolean}
* @default false
* @private
*/
this._isConnectedToTicker = false;
/**
* The speed that the AnimatedSprite will play at. Higher is faster, lower is slower.

@@ -133,9 +141,13 @@ *

this._playing = false;
/**
* Indicates if the AnimatedSprite is currently playing.
* The texture index that was displayed last time
*
* @member {boolean}
* @readonly
* @member {number}
* @private
*/
this.playing = false;
this._previousFrame = null;
this.textures = textures;
}

@@ -147,3 +159,3 @@

var prototypeAccessors = { totalFrames: { configurable: true },textures: { configurable: true },currentFrame: { configurable: true } };
var prototypeAccessors = { totalFrames: { configurable: true },textures: { configurable: true },currentFrame: { configurable: true },playing: { configurable: true },autoUpdate: { configurable: true } };

@@ -161,6 +173,7 @@ /**

this.playing = false;
if (this._autoUpdate)
this._playing = false;
if (this._autoUpdate && this._isConnectedToTicker)
{
Ticker.shared.remove(this.update, this);
this._isConnectedToTicker = false;
}

@@ -180,6 +193,7 @@ };

this.playing = true;
if (this._autoUpdate)
this._playing = true;
if (this._autoUpdate && !this._isConnectedToTicker)
{
Ticker.shared.add(this.update, this, UPDATE_PRIORITY.HIGH);
this._isConnectedToTicker = true;
}

@@ -229,3 +243,2 @@ };

*
* @private
* @param {number} deltaTime - Time since last tick.

@@ -269,4 +282,3 @@ */

{
this._currentTime = 0;
this.stop();
this.gotoAndStop(0);

@@ -280,4 +292,3 @@ if (this.onComplete)

{
this._currentTime = this._textures.length - 1;
this.stop();
this.gotoAndStop(this._textures.length - 1);

@@ -314,3 +325,12 @@ if (this.onComplete)

{
this._texture = this._textures[this.currentFrame];
var currentFrame = this.currentFrame;
if (this._previousFrame === currentFrame)
{
return;
}
this._previousFrame = currentFrame;
this._texture = this._textures[currentFrame];
this._textureID = -1;

@@ -431,2 +451,3 @@ this._textureTrimmedID = -1;

}
this._previousFrame = null;
this.gotoAndStop(0);

@@ -454,2 +475,42 @@ this.updateTexture();

/**
* Indicates if the AnimatedSprite is currently playing.
*
* @member {boolean}
* @readonly
*/
prototypeAccessors.playing.get = function ()
{
return this._playing;
};
/**
* Whether to use PIXI.Ticker.shared to auto update animation time
*
* @member {boolean}
*/
prototypeAccessors.autoUpdate.get = function ()
{
return this._autoUpdate;
};
prototypeAccessors.autoUpdate.set = function (value) // eslint-disable-line require-jsdoc
{
if (value !== this._autoUpdate)
{
this._autoUpdate = value;
if (!this._autoUpdate && this._isConnectedToTicker)
{
Ticker.shared.remove(this.update, this);
this._isConnectedToTicker = false;
}
else if (this._autoUpdate && !this._isConnectedToTicker && this._playing)
{
Ticker.shared.add(this.update, this);
this._isConnectedToTicker = true;
}
}
};
Object.defineProperties( AnimatedSprite.prototype, prototypeAccessors );

@@ -456,0 +517,0 @@

/*!
* @pixi/sprite-animated - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
* @pixi/sprite-animated - v5.2.2
* Compiled Tue, 21 Apr 2020 03:53:51 UTC
*

@@ -66,6 +66,5 @@ * @pixi/sprite-animated is licensed under the MIT License.

this.textures = textures;
/**
* `true` uses PIXI.Ticker.shared to auto update animation time.
*
* @type {boolean}

@@ -78,2 +77,11 @@ * @default true

/**
* `true` if the instance is currently connected to PIXI.Ticker.shared to auto update animation time.
*
* @type {boolean}
* @default false
* @private
*/
this._isConnectedToTicker = false;
/**
* The speed that the AnimatedSprite will play at. Higher is faster, lower is slower.

@@ -137,9 +145,13 @@ *

this._playing = false;
/**
* Indicates if the AnimatedSprite is currently playing.
* The texture index that was displayed last time
*
* @member {boolean}
* @readonly
* @member {number}
* @private
*/
this.playing = false;
this._previousFrame = null;
this.textures = textures;
}

@@ -151,3 +163,3 @@

var prototypeAccessors = { totalFrames: { configurable: true },textures: { configurable: true },currentFrame: { configurable: true } };
var prototypeAccessors = { totalFrames: { configurable: true },textures: { configurable: true },currentFrame: { configurable: true },playing: { configurable: true },autoUpdate: { configurable: true } };

@@ -165,6 +177,7 @@ /**

this.playing = false;
if (this._autoUpdate)
this._playing = false;
if (this._autoUpdate && this._isConnectedToTicker)
{
ticker.Ticker.shared.remove(this.update, this);
this._isConnectedToTicker = false;
}

@@ -184,6 +197,7 @@ };

this.playing = true;
if (this._autoUpdate)
this._playing = true;
if (this._autoUpdate && !this._isConnectedToTicker)
{
ticker.Ticker.shared.add(this.update, this, ticker.UPDATE_PRIORITY.HIGH);
this._isConnectedToTicker = true;
}

@@ -233,3 +247,2 @@ };

*
* @private
* @param {number} deltaTime - Time since last tick.

@@ -273,4 +286,3 @@ */

{
this._currentTime = 0;
this.stop();
this.gotoAndStop(0);

@@ -284,4 +296,3 @@ if (this.onComplete)

{
this._currentTime = this._textures.length - 1;
this.stop();
this.gotoAndStop(this._textures.length - 1);

@@ -318,3 +329,12 @@ if (this.onComplete)

{
this._texture = this._textures[this.currentFrame];
var currentFrame = this.currentFrame;
if (this._previousFrame === currentFrame)
{
return;
}
this._previousFrame = currentFrame;
this._texture = this._textures[currentFrame];
this._textureID = -1;

@@ -435,2 +455,3 @@ this._textureTrimmedID = -1;

}
this._previousFrame = null;
this.gotoAndStop(0);

@@ -458,2 +479,42 @@ this.updateTexture();

/**
* Indicates if the AnimatedSprite is currently playing.
*
* @member {boolean}
* @readonly
*/
prototypeAccessors.playing.get = function ()
{
return this._playing;
};
/**
* Whether to use PIXI.Ticker.shared to auto update animation time
*
* @member {boolean}
*/
prototypeAccessors.autoUpdate.get = function ()
{
return this._autoUpdate;
};
prototypeAccessors.autoUpdate.set = function (value) // eslint-disable-line require-jsdoc
{
if (value !== this._autoUpdate)
{
this._autoUpdate = value;
if (!this._autoUpdate && this._isConnectedToTicker)
{
ticker.Ticker.shared.remove(this.update, this);
this._isConnectedToTicker = false;
}
else if (this._autoUpdate && !this._isConnectedToTicker && this._playing)
{
ticker.Ticker.shared.add(this.update, this);
this._isConnectedToTicker = true;
}
}
};
Object.defineProperties( AnimatedSprite.prototype, prototypeAccessors );

@@ -460,0 +521,0 @@

{
"name": "@pixi/sprite-animated",
"version": "5.2.1",
"version": "5.2.2",
"main": "lib/sprite-animated.js",

@@ -27,7 +27,7 @@ "module": "lib/sprite-animated.es.js",

"dependencies": {
"@pixi/core": "5.2.1",
"@pixi/sprite": "5.2.1",
"@pixi/ticker": "5.2.1"
"@pixi/core": "5.2.2",
"@pixi/sprite": "5.2.2",
"@pixi/ticker": "5.2.2"
},
"gitHead": "b56b4fca1c169f0e6d2a0472251ba1f7399bb4a3"
"gitHead": "c163c466c20f2286b6e41ab90d68a03aad2051d4"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc