@eva/plugin-stats 1.1.1-alpha.0 → 1.1.1-fix.1

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.
Files changed (51) hide show
  1. package/README.md +1 -2
  2. package/dist/plugin-stats.cjs.js +13 -10
  3. package/dist/plugin-stats.cjs.prod.js +2 -2
  4. package/dist/plugin-stats.esm.js +11 -9
  5. package/index.js +3 -3
  6. package/package.json +2 -2
  7. package/dist/EVA.plugin.stats.js +0 -197
  8. package/dist/EVA.plugin.stats.min.js +0 -1
  9. package/dist/examples/index.d.ts +0 -2
  10. package/dist/examples/index.d.ts.map +0 -1
  11. package/dist/examples/src/a11y.d.ts +0 -3
  12. package/dist/examples/src/a11y.d.ts.map +0 -1
  13. package/dist/examples/src/component.d.ts +0 -3
  14. package/dist/examples/src/component.d.ts.map +0 -1
  15. package/dist/examples/src/compressed-texture.d.ts +0 -1
  16. package/dist/examples/src/compressed-texture.d.ts.map +0 -1
  17. package/dist/examples/src/dragonbone.d.ts +0 -3
  18. package/dist/examples/src/dragonbone.d.ts.map +0 -1
  19. package/dist/examples/src/event.d.ts +0 -3
  20. package/dist/examples/src/event.d.ts.map +0 -1
  21. package/dist/examples/src/graphics.d.ts +0 -3
  22. package/dist/examples/src/graphics.d.ts.map +0 -1
  23. package/dist/examples/src/image.d.ts +0 -3
  24. package/dist/examples/src/image.d.ts.map +0 -1
  25. package/dist/examples/src/loader.d.ts +0 -3
  26. package/dist/examples/src/loader.d.ts.map +0 -1
  27. package/dist/examples/src/lottie.d.ts +0 -3
  28. package/dist/examples/src/lottie.d.ts.map +0 -1
  29. package/dist/examples/src/mask.d.ts +0 -4
  30. package/dist/examples/src/mask.d.ts.map +0 -1
  31. package/dist/examples/src/matter.d.ts +0 -3
  32. package/dist/examples/src/matter.d.ts.map +0 -1
  33. package/dist/examples/src/multi-canvas.d.ts +0 -3
  34. package/dist/examples/src/multi-canvas.d.ts.map +0 -1
  35. package/dist/examples/src/ninePatch.d.ts +0 -3
  36. package/dist/examples/src/ninePatch.d.ts.map +0 -1
  37. package/dist/examples/src/sound.d.ts +0 -3
  38. package/dist/examples/src/sound.d.ts.map +0 -1
  39. package/dist/examples/src/spine.d.ts +0 -3
  40. package/dist/examples/src/spine.d.ts.map +0 -1
  41. package/dist/examples/src/sprite.d.ts +0 -3
  42. package/dist/examples/src/sprite.d.ts.map +0 -1
  43. package/dist/examples/src/spriteAnimation.d.ts +0 -3
  44. package/dist/examples/src/spriteAnimation.d.ts.map +0 -1
  45. package/dist/examples/src/text.d.ts +0 -3
  46. package/dist/examples/src/text.d.ts.map +0 -1
  47. package/dist/examples/src/tilingSprite.d.ts +0 -3
  48. package/dist/examples/src/tilingSprite.d.ts.map +0 -1
  49. package/dist/examples/src/transition.d.ts +0 -3
  50. package/dist/examples/src/transition.d.ts.map +0 -1
  51. package/dist/plugin-stats.d.ts +0 -37
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
-
2
1
  # @eva/plugin-stats
3
2
 
4
3
  More Introduction
4
+
5
5
  - [EN](https://eva.js.org)
6
6
  - [中文](https://eva-engine.gitee.io)
7
-
@@ -54,7 +54,8 @@ var StatsComponent = (function (_super) {
54
54
  };
55
55
  StatsComponent.componentName = 'Stats';
56
56
  return StatsComponent;
57
- }(eva_js.Component));
57
+ }(eva_js.Component));
58
+ var Stats$2 = StatsComponent;
58
59
 
59
60
  var Stats = function (style) {
60
61
  style = __assign({ width: 20, height: 12, x: 0, y: 0 }, style);
@@ -151,7 +152,8 @@ Stats.Panel = function (name, fg, bg) {
151
152
  context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round((1 - value / maxValue) * GRAPH_HEIGHT));
152
153
  },
153
154
  };
154
- };
155
+ };
156
+ var Stats$1 = Stats;
155
157
 
156
158
  var StatsSystem = (function (_super) {
157
159
  __extends(StatsSystem, _super);
@@ -168,8 +170,8 @@ var StatsSystem = (function (_super) {
168
170
  StatsSystem.prototype.start = function () {
169
171
  if (!this.show)
170
172
  return;
171
- this.component = this.game.scene.addComponent(new StatsComponent());
172
- this.stats = Stats(this.style);
173
+ this.component = this.game.scene.addComponent(new Stats$2());
174
+ this.stats = Stats$1(this.style);
173
175
  this.component.stats = this.stats;
174
176
  this.stats.showPanel(0);
175
177
  document.body.appendChild(this.stats.dom);
@@ -181,13 +183,14 @@ var StatsSystem = (function (_super) {
181
183
  };
182
184
  StatsSystem.systemName = 'Stats';
183
185
  return StatsSystem;
184
- }(eva_js.System));
186
+ }(eva_js.System));
187
+ var StatsSystem$1 = StatsSystem;
185
188
 
186
189
  var index = {
187
- Components: [StatsComponent],
188
- Systems: [StatsSystem],
190
+ Components: [Stats$2],
191
+ Systems: [StatsSystem$1],
189
192
  };
190
193
 
191
- exports.Stats = StatsComponent;
192
- exports.StatsSystem = StatsSystem;
193
- exports.default = index;
194
+ exports.Stats = Stats$2;
195
+ exports.StatsSystem = StatsSystem$1;
196
+ exports["default"] = index;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@eva/eva.js"),e=function(t,n){return(e=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,n)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@eva/eva.js"),e=function(t,n){return e=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])},e(t,n)};
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -12,4 +12,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
12
12
 
13
13
  See the Apache Version 2.0 License for specific language governing permissions
14
14
  and limitations under the License.
15
- ***************************************************************************** */function n(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}var o=function(){return(o=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)},i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.update=function(){this.stats&&this.stats.begin()},e.componentName="Stats",e}(t.Component),s=function(t){var e=(t=o({width:20,height:12,x:0,y:0},t)).width,n=t.height,i=t.x,a=t.y,r=0,l=document.createElement("div");function c(t){return l.appendChild(t.dom),t}function p(t){for(var e=0;e<l.children.length;e++)l.children[e].style.display=e===t?"block":"none";r=t}l.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: "+e+"vw;height: "+n+"vw;left: "+i+"vw;top: "+a+"vw;",l.addEventListener("click",(function(t){t.preventDefault(),p(++r%l.children.length)}),!1);var f,h=(performance||Date).now(),u=h,d=0,y=c(s.Panel("FPS","#0ff","#002")),m=c(s.Panel("MS","#0f0","#020"));return self.performance&&self.performance.memory&&(f=c(s.Panel("MB","#f08","#201"))),p(0),{REVISION:16,dom:l,addPanel:c,showPanel:p,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,f)){var e=performance.memory;f.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){h=this.end()},domElement:l,setMode:p}};s.Panel=function(t,e,n){var o=1/0,i=0,s=Math.round,a=s(window.devicePixelRatio||1),r=80*a,l=48*a,c=3*a,p=2*a,f=3*a,h=15*a,u=74*a,d=30*a,y=document.createElement("canvas");y.width=r,y.height=l,y.style.cssText="width:100%;height:100%";var m=y.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=n,m.fillRect(0,0,r,l),m.fillStyle=e,m.fillText(t,c,p),m.fillRect(f,h,u,d),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(f,h,u,d),{dom:y,update:function(l,v){o=Math.min(o,l),i=Math.max(i,l),m.fillStyle=n,m.globalAlpha=1,m.fillRect(0,0,r,h),m.fillStyle=e,m.fillText(s(l)+" "+t+" ("+s(o)+"-"+s(i)+")",c,p),m.drawImage(y,f+a,h,u-a,d,f,h,u-a,d),m.fillRect(f+u-a,h,a,d),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(f+u-a,h,a,s((1-l/v)*d))}}};var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.show=!0,e}return n(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 i),this.stats=s(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}(t.System),r={Components:[i],Systems:[a]};exports.Stats=i,exports.StatsSystem=a,exports.default=r;
15
+ ***************************************************************************** */function n(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}var o=function(){return o=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},o.apply(this,arguments)},i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.update=function(){this.stats&&this.stats.begin()},e.componentName="Stats",e}(t.Component),s=function(t){var e=(t=o({width:20,height:12,x:0,y:0},t)).width,n=t.height,i=t.x,a=t.y,r=0,l=document.createElement("div");function c(t){return l.appendChild(t.dom),t}function p(t){for(var e=0;e<l.children.length;e++)l.children[e].style.display=e===t?"block":"none";r=t}l.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: "+e+"vw;height: "+n+"vw;left: "+i+"vw;top: "+a+"vw;",l.addEventListener("click",(function(t){t.preventDefault(),p(++r%l.children.length)}),!1);var f,h=(performance||Date).now(),u=h,d=0,y=c(s.Panel("FPS","#0ff","#002")),m=c(s.Panel("MS","#0f0","#020"));return self.performance&&self.performance.memory&&(f=c(s.Panel("MB","#f08","#201"))),p(0),{REVISION:16,dom:l,addPanel:c,showPanel:p,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,f)){var e=performance.memory;f.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){h=this.end()},domElement:l,setMode:p}};s.Panel=function(t,e,n){var o=1/0,i=0,s=Math.round,a=s(window.devicePixelRatio||1),r=80*a,l=48*a,c=3*a,p=2*a,f=3*a,h=15*a,u=74*a,d=30*a,y=document.createElement("canvas");y.width=r,y.height=l,y.style.cssText="width:100%;height:100%";var m=y.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=n,m.fillRect(0,0,r,l),m.fillStyle=e,m.fillText(t,c,p),m.fillRect(f,h,u,d),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(f,h,u,d),{dom:y,update:function(l,v){o=Math.min(o,l),i=Math.max(i,l),m.fillStyle=n,m.globalAlpha=1,m.fillRect(0,0,r,h),m.fillStyle=e,m.fillText(s(l)+" "+t+" ("+s(o)+"-"+s(i)+")",c,p),m.drawImage(y,f+a,h,u-a,d,f,h,u-a,d),m.fillRect(f+u-a,h,a,d),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(f+u-a,h,a,s((1-l/v)*d))}}};var a=s,r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.show=!0,e}return n(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 i),this.stats=a(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}(t.System),l={Components:[i],Systems:[r]};exports.Stats=i,exports.StatsSystem=r,exports.default=l;
@@ -50,7 +50,8 @@ var StatsComponent = (function (_super) {
50
50
  };
51
51
  StatsComponent.componentName = 'Stats';
52
52
  return StatsComponent;
53
- }(Component));
53
+ }(Component));
54
+ var Stats$2 = StatsComponent;
54
55
 
55
56
  var Stats = function (style) {
56
57
  style = __assign({ width: 20, height: 12, x: 0, y: 0 }, style);
@@ -147,7 +148,8 @@ Stats.Panel = function (name, fg, bg) {
147
148
  context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round((1 - value / maxValue) * GRAPH_HEIGHT));
148
149
  },
149
150
  };
150
- };
151
+ };
152
+ var Stats$1 = Stats;
151
153
 
152
154
  var StatsSystem = (function (_super) {
153
155
  __extends(StatsSystem, _super);
@@ -164,8 +166,8 @@ var StatsSystem = (function (_super) {
164
166
  StatsSystem.prototype.start = function () {
165
167
  if (!this.show)
166
168
  return;
167
- this.component = this.game.scene.addComponent(new StatsComponent());
168
- this.stats = Stats(this.style);
169
+ this.component = this.game.scene.addComponent(new Stats$2());
170
+ this.stats = Stats$1(this.style);
169
171
  this.component.stats = this.stats;
170
172
  this.stats.showPanel(0);
171
173
  document.body.appendChild(this.stats.dom);
@@ -177,12 +179,12 @@ var StatsSystem = (function (_super) {
177
179
  };
178
180
  StatsSystem.systemName = 'Stats';
179
181
  return StatsSystem;
180
- }(System));
182
+ }(System));
183
+ var StatsSystem$1 = StatsSystem;
181
184
 
182
185
  var index = {
183
- Components: [StatsComponent],
184
- Systems: [StatsSystem],
186
+ Components: [Stats$2],
187
+ Systems: [StatsSystem$1],
185
188
  };
186
189
 
187
- export default index;
188
- export { StatsComponent as Stats, StatsSystem };
190
+ export { Stats$2 as Stats, StatsSystem$1 as StatsSystem, index as default };
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
- 'use strict'
1
+ 'use strict';
2
2
 
3
3
  if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./dist/plugin-stats.cjs.prod.js')
4
+ module.exports = require('./dist/plugin-stats.cjs.prod.js');
5
5
  } else {
6
- module.exports = require('./dist/plugin-stats.cjs.js')
6
+ module.exports = require('./dist/plugin-stats.cjs.js');
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-stats",
3
- "version": "1.1.1-alpha.0",
3
+ "version": "1.1.1-fix.1",
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.1.1-alpha.0",
21
+ "@eva/eva.js": "1.1.1-fix.1",
22
22
  "lodash-es": "^4.17.21"
23
23
  }
24
24
  }
@@ -1,197 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@eva/eva.js')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@eva/eva.js'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.EVA = global.EVA || {}, global.EVA.plugin = global.EVA.plugin || {}, global.EVA.plugin.stats = {}), global.EVA));
5
- }(this, (function (exports, eva_js) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- var StatsComponent = (function (_super) {
48
- __extends(StatsComponent, _super);
49
- function StatsComponent() {
50
- return _super !== null && _super.apply(this, arguments) || this;
51
- }
52
- StatsComponent.prototype.update = function () {
53
- this.stats && this.stats.begin();
54
- };
55
- StatsComponent.componentName = 'Stats';
56
- return StatsComponent;
57
- }(eva_js.Component));
58
-
59
- var Stats = function (style) {
60
- style = __assign({ width: 20, height: 12, x: 0, y: 0 }, style);
61
- var width = style.width, height = style.height, x = style.x, y = style.y;
62
- var mode = 0;
63
- var container = document.createElement('div');
64
- container.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;width: " + width + "vw;height: " + height + "vw;left: " + x + "vw;top: " + y + "vw;";
65
- container.addEventListener('click', function (event) {
66
- event.preventDefault();
67
- showPanel(++mode % container.children.length);
68
- }, false);
69
- function addPanel(panel) {
70
- container.appendChild(panel.dom);
71
- return panel;
72
- }
73
- function showPanel(id) {
74
- for (var i = 0; i < container.children.length; i++) {
75
- container.children[i].style.display = i === id ? 'block' : 'none';
76
- }
77
- mode = id;
78
- }
79
- var beginTime = (performance || Date).now(), prevTime = beginTime, frames = 0;
80
- var fpsPanel = addPanel(Stats.Panel('FPS', '#0ff', '#002'));
81
- var msPanel = addPanel(Stats.Panel('MS', '#0f0', '#020'));
82
- var memPanel;
83
- if (self.performance && self.performance.memory) {
84
- memPanel = addPanel(Stats.Panel('MB', '#f08', '#201'));
85
- }
86
- showPanel(0);
87
- return {
88
- REVISION: 16,
89
- dom: container,
90
- addPanel: addPanel,
91
- showPanel: showPanel,
92
- begin: function (time) {
93
- beginTime = time || (performance || Date).now();
94
- },
95
- end: function () {
96
- frames++;
97
- var time = (performance || Date).now();
98
- msPanel.update(time - beginTime, 200);
99
- if (time >= prevTime + 1000) {
100
- fpsPanel.update((frames * 1000) / (time - prevTime), 100);
101
- prevTime = time;
102
- frames = 0;
103
- if (memPanel) {
104
- var memory = performance.memory;
105
- memPanel.update(memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576);
106
- }
107
- }
108
- return time;
109
- },
110
- update: function () {
111
- beginTime = this.end();
112
- },
113
- domElement: container,
114
- setMode: showPanel,
115
- };
116
- };
117
- Stats.Panel = function (name, fg, bg) {
118
- var min = Infinity, max = 0;
119
- var round = Math.round;
120
- var PR = round(window.devicePixelRatio || 1);
121
- var WIDTH = 80 * PR, HEIGHT = 48 * PR, TEXT_X = 3 * PR, TEXT_Y = 2 * PR, GRAPH_X = 3 * PR, GRAPH_Y = 15 * PR, GRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;
122
- var canvas = document.createElement('canvas');
123
- canvas.width = WIDTH;
124
- canvas.height = HEIGHT;
125
- canvas.style.cssText = 'width:100%;height:100%';
126
- var context = canvas.getContext('2d');
127
- context.font = 'bold ' + 9 * PR + 'px Helvetica,Arial,sans-serif';
128
- context.textBaseline = 'top';
129
- context.fillStyle = bg;
130
- context.fillRect(0, 0, WIDTH, HEIGHT);
131
- context.fillStyle = fg;
132
- context.fillText(name, TEXT_X, TEXT_Y);
133
- context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
134
- context.fillStyle = bg;
135
- context.globalAlpha = 0.9;
136
- context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT);
137
- return {
138
- dom: canvas,
139
- update: function (value, maxValue) {
140
- min = Math.min(min, value);
141
- max = Math.max(max, value);
142
- context.fillStyle = bg;
143
- context.globalAlpha = 1;
144
- context.fillRect(0, 0, WIDTH, GRAPH_Y);
145
- context.fillStyle = fg;
146
- context.fillText(round(value) + ' ' + name + ' (' + round(min) + '-' + round(max) + ')', TEXT_X, TEXT_Y);
147
- context.drawImage(canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT);
148
- context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT);
149
- context.fillStyle = bg;
150
- context.globalAlpha = 0.9;
151
- context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round((1 - value / maxValue) * GRAPH_HEIGHT));
152
- },
153
- };
154
- };
155
-
156
- var StatsSystem = (function (_super) {
157
- __extends(StatsSystem, _super);
158
- function StatsSystem() {
159
- var _this = _super !== null && _super.apply(this, arguments) || this;
160
- _this.show = true;
161
- return _this;
162
- }
163
- StatsSystem.prototype.init = function (param) {
164
- if (param === void 0) { param = { show: true }; }
165
- this.show = param.show;
166
- this.style = param.style;
167
- };
168
- StatsSystem.prototype.start = function () {
169
- if (!this.show)
170
- return;
171
- this.component = this.game.scene.addComponent(new StatsComponent());
172
- this.stats = Stats(this.style);
173
- this.component.stats = this.stats;
174
- this.stats.showPanel(0);
175
- document.body.appendChild(this.stats.dom);
176
- };
177
- StatsSystem.prototype.lateUpdate = function () {
178
- if (!this.show)
179
- return;
180
- this.stats && this.stats.end();
181
- };
182
- StatsSystem.systemName = 'Stats';
183
- return StatsSystem;
184
- }(eva_js.System));
185
-
186
- var index = {
187
- Components: [StatsComponent],
188
- Systems: [StatsSystem],
189
- };
190
-
191
- exports.Stats = StatsComponent;
192
- exports.StatsSystem = StatsSystem;
193
- exports.default = index;
194
-
195
- Object.defineProperty(exports, '__esModule', { value: true });
196
-
197
- })));
@@ -1 +0,0 @@
1
- var t,e;t=this,e=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){var e=(t=i({width:20,height:12,x:0,y:0},t)).width,n=t.height,o=t.x,a=t.y,l=0,r=document.createElement("div");function f(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: "+e+"vw;height: "+n+"vw;left: "+o+"vw;top: "+a+"vw;",r.addEventListener("click",(function(t){t.preventDefault(),p(++l%r.children.length)}),!1);var c,h=(performance||Date).now(),u=h,d=0,y=f(s.Panel("FPS","#0ff","#002")),m=f(s.Panel("MS","#0f0","#020"));return self.performance&&self.performance.memory&&(c=f(s.Panel("MB","#f08","#201"))),p(0),{REVISION:16,dom:r,addPanel:f,showPanel:p,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,c)){var e=performance.memory;c.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){h=this.end()},domElement:r,setMode:p}};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,f=3*s,p=2*s,c=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,f,p),m.fillRect(c,h,u,d),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(c,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)+")",f,p),m.drawImage(y,c+s,h,u-s,d,c,h,u-s,d),m.fillRect(c+u-s,h,s,d),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(c+u-s,h,s,a((1-r/v)*d))}}};var l=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=s(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),r={Components:[a],Systems:[l]};t.Stats=a,t.StatsSystem=l,t.default=r,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@eva/eva.js")):"function"==typeof define&&define.amd?define(["exports","@eva/eva.js"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).EVA=t.EVA||{},t.EVA.plugin=t.EVA.plugin||{},t.EVA.plugin.stats={}),t.EVA);
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export declare const name = "a11y";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=a11y.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["a11y.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAmYhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "component";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["component.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,cAAc,CAAC;AAChC,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAsJhC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=compressed-texture.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compressed-texture.d.ts","sourceRoot":"","sources":["compressed-texture.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export declare const name = "dragonbone";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=dragonbone.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dragonbone.d.ts","sourceRoot":"","sources":["dragonbone.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,eAAe,CAAC;AACjC,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA8DhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "event";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=event.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["event.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,UAAU,CAAC;AAC5B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAiFhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "graphics";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=graphics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphics.d.ts","sourceRoot":"","sources":["graphics.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,aAAa,CAAC;AAC/B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAsDhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "image";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=image.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["image.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,UAAU,CAAC;AAC5B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA8ChC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "loader";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["loader.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,WAAW,CAAC;AAC7B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA0HhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "lottie";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=lottie.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lottie.d.ts","sourceRoot":"","sources":["lottie.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,WAAW,CAAC;AAE7B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAmHhC"}
@@ -1,4 +0,0 @@
1
- import "@eva/plugin-renderer-sprite";
2
- export declare const name = "mask";
3
- export declare function init(canavs: any): Promise<void>;
4
- //# sourceMappingURL=mask.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["mask.ts"],"names":[],"mappings":"AAGA,OAAO,6BAA6B,CAAC;AAErC,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAoHhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "matter";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=matter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"matter.d.ts","sourceRoot":"","sources":["matter.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,IAAI,WAAW,CAAC;AAC7B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA4ahC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "multi-canavs";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=multi-canvas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multi-canvas.d.ts","sourceRoot":"","sources":["multi-canvas.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,iBAAiB,CAAC;AACnC,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAoFhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "ninePatch";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=ninePatch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ninePatch.d.ts","sourceRoot":"","sources":["ninePatch.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,cAAc,CAAC;AAChC,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA2EhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "sound";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=sound.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sound.d.ts","sourceRoot":"","sources":["sound.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,UAAU,CAAC;AAC5B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA2NhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "spine";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=spine.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spine.d.ts","sourceRoot":"","sources":["spine.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,UAAU,CAAC;AAC5B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA+DhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "sprite";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=sprite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sprite.d.ts","sourceRoot":"","sources":["sprite.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI,WAAW,CAAC;AAC7B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA4HhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "spriteAnimation";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=spriteAnimation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spriteAnimation.d.ts","sourceRoot":"","sources":["spriteAnimation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,oBAAoB,CAAC;AACtC,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAwDhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "text";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=text.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,SAAS,CAAA;AAC1B,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBA+DhC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "tilingSprite";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=tilingSprite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tilingSprite.d.ts","sourceRoot":"","sources":["tilingSprite.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,iBAAiB,CAAC;AACnC,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAuChC"}
@@ -1,3 +0,0 @@
1
- export declare const name = "transition";
2
- export declare function init(canvas: any): Promise<void>;
3
- //# sourceMappingURL=transition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["transition.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI,eAAe,CAAC;AACjC,wBAAsB,IAAI,CAAC,MAAM,KAAA,iBAoIhC"}
@@ -1,37 +0,0 @@
1
- import { Component } from '@eva/eva.js';
2
- import { System } from '@eva/eva.js';
3
-
4
- declare const _default: {
5
- Components: (typeof Stats)[];
6
- Systems: (typeof StatsSystem)[];
7
- };
8
- export default _default;
9
-
10
- export declare class Stats extends Component {
11
- static componentName: string;
12
- stats: any;
13
- update(): void;
14
- }
15
-
16
- declare interface StatsParams {
17
- show?: boolean;
18
- style?: {
19
- width: number;
20
- height: number;
21
- x: number;
22
- y: number;
23
- };
24
- }
25
-
26
- export declare class StatsSystem extends System {
27
- static systemName: string;
28
- show: boolean;
29
- stats: any;
30
- style: any;
31
- component: Stats;
32
- init(param?: StatsParams): void;
33
- start(): void;
34
- lateUpdate(): void;
35
- }
36
-
37
- export { }