Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/ticker

Package Overview
Dependencies
Maintainers
3
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/ticker - npm Package Compare versions

Comparing version 5.2.0 to 5.2.1

24

dist/ticker.js
/*!
* @pixi/ticker - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
* @pixi/ticker - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*

@@ -473,2 +473,22 @@ * @pixi/ticker is licensed under the MIT License.

};
Object.defineProperty(Ticker.prototype, "count", {
/**
* Counts the number of listeners on this ticker.
*
* @returns {number} The number of listeners on this ticker
*/
get: function () {
if (!this._head) {
return 0;
}
var count = 0;
var current = this._head;
while ((current = current.next)) {
count++;
}
return count;
},
enumerable: true,
configurable: true
});
/**

@@ -475,0 +495,0 @@ * Starts the ticker. If the ticker has listeners

6

dist/ticker.min.js
/*!
* @pixi/ticker - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
* @pixi/ticker - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*

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

*/
this.PIXI=this.PIXI||{};var _pixi_ticker=function(t,e){"use strict";var i;e.settings.TARGET_FPMS=.06,(i=t.UPDATE_PRIORITY||(t.UPDATE_PRIORITY={}))[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY";var s=function(){function t(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=0),void 0===s&&(s=!1),this.fn=t,this.context=e,this.priority=i,this.once=s,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),n=function(){function i(){var t=this;this._head=new s(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/e.settings.TARGET_FPMS,this.elapsedMS=1/e.settings.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return i.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},i.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},i.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},i.prototype.add=function(e,i,n){return void 0===n&&(n=t.UPDATE_PRIORITY.NORMAL),this._addListener(new s(e,i,n))},i.prototype.addOnce=function(e,i,n){return void 0===n&&(n=t.UPDATE_PRIORITY.NORMAL),this._addListener(new s(e,i,n,!0))},i.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},i.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},i.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},i.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},i.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},i.prototype.update=function(t){var i;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((i=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS){var s=t-this._lastFrame|0;if(s<this._minElapsedMS)return;this._lastFrame=t-s%this._minElapsedMS}this.deltaMS=i,this.deltaTime=this.deltaMS*e.settings.TARGET_FPMS;for(var n=this._head,r=n.next;r;)r=r.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(i.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var i=Math.min(this.maxFPS,t),s=Math.min(Math.max(0,i)/1e3,e.settings.TARGET_FPMS);this._maxElapsedMS=1/s},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!0,configurable:!0}),Object.defineProperty(i,"shared",{get:function(){if(!i._shared){var t=i._shared=new i;t.autoStart=!0,t._protected=!0}return i._shared},enumerable:!0,configurable:!0}),Object.defineProperty(i,"system",{get:function(){if(!i._system){var t=i._system=new i;t.autoStart=!0,t._protected=!0}return i._system},enumerable:!0,configurable:!0}),i}(),r=function(){function e(){}return e.init=function(e){var i=this;e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set:function(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,t.UPDATE_PRIORITY.LOW)},get:function(){return this._ticker}}),this.stop=function(){i._ticker.stop()},this.start=function(){i._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?n.shared:new n,e.autoStart&&this.start()},e.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},e}();return t.Ticker=n,t.TickerPlugin=r,t}({},PIXI);Object.assign(this.PIXI,_pixi_ticker);
this.PIXI=this.PIXI||{};var _pixi_ticker=function(t,e){"use strict";var i;e.settings.TARGET_FPMS=.06,(i=t.UPDATE_PRIORITY||(t.UPDATE_PRIORITY={}))[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY";var s=function(){function t(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=0),void 0===s&&(s=!1),this.fn=t,this.context=e,this.priority=i,this.once=s,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),n=function(){function i(){var t=this;this._head=new s(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/e.settings.TARGET_FPMS,this.elapsedMS=1/e.settings.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return i.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},i.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},i.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},i.prototype.add=function(e,i,n){return void 0===n&&(n=t.UPDATE_PRIORITY.NORMAL),this._addListener(new s(e,i,n))},i.prototype.addOnce=function(e,i,n){return void 0===n&&(n=t.UPDATE_PRIORITY.NORMAL),this._addListener(new s(e,i,n,!0))},i.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},i.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(i.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!0,configurable:!0}),i.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},i.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},i.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},i.prototype.update=function(t){var i;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((i=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS){var s=t-this._lastFrame|0;if(s<this._minElapsedMS)return;this._lastFrame=t-s%this._minElapsedMS}this.deltaMS=i,this.deltaTime=this.deltaMS*e.settings.TARGET_FPMS;for(var n=this._head,r=n.next;r;)r=r.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(i.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var i=Math.min(this.maxFPS,t),s=Math.min(Math.max(0,i)/1e3,e.settings.TARGET_FPMS);this._maxElapsedMS=1/s},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!0,configurable:!0}),Object.defineProperty(i,"shared",{get:function(){if(!i._shared){var t=i._shared=new i;t.autoStart=!0,t._protected=!0}return i._shared},enumerable:!0,configurable:!0}),Object.defineProperty(i,"system",{get:function(){if(!i._system){var t=i._system=new i;t.autoStart=!0,t._protected=!0}return i._system},enumerable:!0,configurable:!0}),i}(),r=function(){function e(){}return e.init=function(e){var i=this;e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set:function(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,t.UPDATE_PRIORITY.LOW)},get:function(){return this._ticker}}),this.stop=function(){i._ticker.stop()},this.start=function(){i._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?n.shared:new n,e.autoStart&&this.start()},e.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},e}();return t.Ticker=n,t.TickerPlugin=r,t}({},PIXI);Object.assign(this.PIXI,_pixi_ticker);
//# sourceMappingURL=ticker.min.js.map
/*!
* @pixi/ticker - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
* @pixi/ticker - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*

@@ -472,2 +472,22 @@ * @pixi/ticker is licensed under the MIT License.

};
Object.defineProperty(Ticker.prototype, "count", {
/**
* Counts the number of listeners on this ticker.
*
* @returns {number} The number of listeners on this ticker
*/
get: function () {
if (!this._head) {
return 0;
}
var count = 0;
var current = this._head;
while ((current = current.next)) {
count++;
}
return count;
},
enumerable: true,
configurable: true
});
/**

@@ -474,0 +494,0 @@ * Starts the ticker. If the ticker has listeners

/*!
* @pixi/ticker - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
* @pixi/ticker - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*

@@ -475,2 +475,22 @@ * @pixi/ticker is licensed under the MIT License.

};
Object.defineProperty(Ticker.prototype, "count", {
/**
* Counts the number of listeners on this ticker.
*
* @returns {number} The number of listeners on this ticker
*/
get: function () {
if (!this._head) {
return 0;
}
var count = 0;
var current = this._head;
while ((current = current.next)) {
count++;
}
return count;
},
enumerable: true,
configurable: true
});
/**

@@ -477,0 +497,0 @@ * Starts the ticker. If the ticker has listeners

{
"name": "@pixi/ticker",
"version": "5.2.0",
"version": "5.2.1",
"main": "lib/ticker.js",

@@ -27,5 +27,5 @@ "module": "lib/ticker.es.js",

"dependencies": {
"@pixi/settings": "^5.2.0"
"@pixi/settings": "5.2.1"
},
"gitHead": "aaf96b460582b83a1fa73037ef2dd69dd9e84415"
"gitHead": "b56b4fca1c169f0e6d2a0472251ba1f7399bb4a3"
}

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