@eva/plugin-stats 1.2.4 → 1.2.6
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)},
|
|
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.
|
|
3
|
+
"version": "1.2.6",
|
|
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.
|
|
21
|
+
"@eva/eva.js": "1.2.6",
|
|
22
22
|
"lodash-es": "^4.17.21"
|
|
23
23
|
}
|
|
24
24
|
}
|