@eva/plugin-stats 1.2.5 → 1.2.6-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var _EVA_IIFE_stats=function(t,e){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.update=function(){this.stats&&this.stats.begin()},e.componentName="Stats",e}(e.Component),s=function t(e){var n=(e=i({width:20,height:12,x:0,y:0},e)).width,o=e.height,a=e.x,s=e.y,l=0,r=document.createElement("div");function c(t){return r.appendChild(t.dom),t}function f(t){for(var e=0;e<r.children.length;e++)r.children[e].style.display=e===t?"block":"none";l=t}r.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: "+n+"vw;height: "+o+"vw;left: "+a+"vw;top: "+s+"vw;",r.addEventListener("click",(function(t){t.preventDefault(),f(++l%r.children.length)}),!1);var p,h=(performance||Date).now(),u=h,d=0,y=c(t.Panel("FPS","#0ff","#002")),m=c(t.Panel("MS","#0f0","#020"));return self.performance&&self.performance.memory&&(p=c(t.Panel("MB","#f08","#201"))),f(0),{REVISION:16,dom:r,addPanel:c,showPanel:f,begin:function(t){h=t||(performance||Date).now()},end:function(){d++;var t=(performance||Date).now();if(m.update(t-h,200),t>=u+1e3&&(y.update(1e3*d/(t-u),100),u=t,d=0,p)){var e=performance.memory;p.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){h=this.end()},domElement:r,setMode:f}};s.Panel=function(t,e,n){var o=1/0,i=0,a=Math.round,s=a(window.devicePixelRatio||1),l=80*s,r=48*s,c=3*s,f=2*s,p=3*s,h=15*s,u=74*s,d=30*s,y=document.createElement("canvas");y.width=l,y.height=r,y.style.cssText="width:100%;height:100%";var m=y.getContext("2d");return m.font="bold "+9*s+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=n,m.fillRect(0,0,l,r),m.fillStyle=e,m.fillText(t,c,f),m.fillRect(p,h,u,d),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(p,h,u,d),{dom:y,update:function(r,v){o=Math.min(o,r),i=Math.max(i,r),m.fillStyle=n,m.globalAlpha=1,m.fillRect(0,0,l,h),m.fillStyle=e,m.fillText(a(r)+" "+t+" ("+a(o)+"-"+a(i)+")",c,f),m.drawImage(y,p+s,h,u-s,d,p,h,u-s,d),m.fillRect(p+u-s,h,s,d),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(p+u-s,h,s,a((1-r/v)*d))}}};var l=s,r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.show=!0,e}return o(e,t),e.prototype.init=function(t){void 0===t&&(t={show:!0}),this.show=t.show,this.style=t.style},e.prototype.start=function(){this.show&&(this.component=this.game.scene.addComponent(new a),this.stats=l(this.style),this.component.stats=this.stats,this.stats.showPanel(0),document.body.appendChild(this.stats.dom))},e.prototype.lateUpdate=function(){this.show&&this.stats&&this.stats.end()},e.systemName="Stats",e}(e.System),c={Components:[a],Systems:[r]};return t.Stats=a,t.StatsSystem=r,t.default=c,Object.defineProperty(t,"__esModule",{value:!0}),t}({},EVA);
1
+ window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{};var _EVA_IIFE_stats=function(t,e){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.update=function(){this.stats&&this.stats.begin()},e.componentName="Stats",e}(e.Component),a=function t(e){var n=(e=i({width:20,height:12,x:0,y:0},e)).width,o=e.height,s=e.x,a=e.y,l=0,r=document.createElement("div");function c(t){return r.appendChild(t.dom),t}function p(t){for(var e=0;e<r.children.length;e++)r.children[e].style.display=e===t?"block":"none";l=t}r.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: "+n+"vw;height: "+o+"vw;left: "+s+"vw;top: "+a+"vw;",r.addEventListener("click",(function(t){t.preventDefault(),p(++l%r.children.length)}),!1);var f,h=(performance||Date).now(),u=h,d=0,w=c(t.Panel("FPS","#0ff","#002")),y=c(t.Panel("MS","#0f0","#020"));return self.performance&&self.performance.memory&&(f=c(t.Panel("MB","#f08","#201"))),p(0),{REVISION:16,dom:r,addPanel:c,showPanel:p,begin:function(t){h=t||(performance||Date).now()},end:function(){d++;var t=(performance||Date).now();if(y.update(t-h,200),t>=u+1e3&&(w.update(1e3*d/(t-u),100),u=t,d=0,f)){var e=performance.memory;f.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){h=this.end()},domElement:r,setMode:p}};a.Panel=function(t,e,n){var o=1/0,i=0,s=Math.round,a=s(window.devicePixelRatio||1),l=80*a,r=48*a,c=3*a,p=2*a,f=3*a,h=15*a,u=74*a,d=30*a,w=document.createElement("canvas");w.width=l,w.height=r,w.style.cssText="width:100%;height:100%";var y=w.getContext("2d");return y.font="bold "+9*a+"px Helvetica,Arial,sans-serif",y.textBaseline="top",y.fillStyle=n,y.fillRect(0,0,l,r),y.fillStyle=e,y.fillText(t,c,p),y.fillRect(f,h,u,d),y.fillStyle=n,y.globalAlpha=.9,y.fillRect(f,h,u,d),{dom:w,update:function(r,m){o=Math.min(o,r),i=Math.max(i,r),y.fillStyle=n,y.globalAlpha=1,y.fillRect(0,0,l,h),y.fillStyle=e,y.fillText(s(r)+" "+t+" ("+s(o)+"-"+s(i)+")",c,p),y.drawImage(w,f+a,h,u-a,d,f,h,u-a,d),y.fillRect(f+u-a,h,a,d),y.fillStyle=n,y.globalAlpha=.9,y.fillRect(f+u-a,h,a,s((1-r/m)*d))}}};var l=a,r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.show=!0,e}return o(e,t),e.prototype.init=function(t){void 0===t&&(t={show:!0}),this.show=t.show,this.style=t.style},e.prototype.start=function(){this.show&&(this.component=this.game.scene.addComponent(new s),this.stats=l(this.style),this.component.stats=this.stats,this.stats.showPanel(0),document.body.appendChild(this.stats.dom))},e.prototype.lateUpdate=function(){this.show&&this.stats&&this.stats.end()},e.systemName="Stats",e}(e.System),c={Components:[s],Systems:[r]};return t.Stats=s,t.StatsSystem=r,t.default=c,Object.defineProperty(t,"__esModule",{value:!0}),t}({},EVA);window.EVA.plugin.stats=window.EVA.plugin.stats||_EVA_IIFE_stats;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-stats",
3
- "version": "1.2.5",
3
+ "version": "1.2.6-alpha.0",
4
4
  "description": "@eva/plugin-stats",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-stats.esm.js",
@@ -18,7 +18,7 @@
18
18
  "license": "MIT",
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
- "@eva/eva.js": "1.2.5",
21
+ "@eva/eva.js": "1.2.6-alpha.0",
22
22
  "lodash-es": "^4.17.21"
23
23
  }
24
24
  }