@eva/plugin-renderer-graphics 2.0.0-beta.1 → 2.0.0-beta.2

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.
@@ -3,23 +3,18 @@ window.EVA.plugin = window.EVA.plugin || {};
3
3
  window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
4
4
  var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
5
5
  'use strict';
6
- var extendStatics = function (d, b) {
7
- extendStatics = Object.setPrototypeOf || {
8
- __proto__: []
9
- } instanceof Array && function (d, b) {
10
- d.__proto__ = b;
11
- } || function (d, b) {
12
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
13
- };
14
- return extendStatics(d, b);
15
- };
16
- function __extends(d, b) {
17
- extendStatics(d, b);
18
- function __() {
19
- this.constructor = d;
6
+
7
+ class Graphics$3 extends pixi_js.Graphics {}
8
+ class Graphics$2 extends eva_js.Component {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.graphics = null;
12
+ }
13
+ init() {
14
+ this.graphics = new Graphics$3();
20
15
  }
21
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
22
16
  }
17
+ Graphics$2.componentName = 'Graphics';
23
18
  function __decorate(decorators, target, key, desc) {
24
19
  var c = arguments.length,
25
20
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
@@ -54,150 +49,34 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
54
49
  step((generator = generator.apply(thisArg, _arguments || [])).next());
55
50
  });
56
51
  }
57
- function __generator(thisArg, body) {
58
- var _ = {
59
- label: 0,
60
- sent: function () {
61
- if (t[0] & 1) throw t[1];
62
- return t[1];
63
- },
64
- trys: [],
65
- ops: []
66
- },
67
- f,
68
- y,
69
- t,
70
- g;
71
- return g = {
72
- next: verb(0),
73
- "throw": verb(1),
74
- "return": verb(2)
75
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
76
- return this;
77
- }), g;
78
- function verb(n) {
79
- return function (v) {
80
- return step([n, v]);
81
- };
82
- }
83
- function step(op) {
84
- if (f) throw new TypeError("Generator is already executing.");
85
- while (_) try {
86
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
87
- if (y = 0, t) op = [op[0] & 2, t.value];
88
- switch (op[0]) {
89
- case 0:
90
- case 1:
91
- t = op;
92
- break;
93
- case 4:
94
- _.label++;
95
- return {
96
- value: op[1],
97
- done: false
98
- };
99
- case 5:
100
- _.label++;
101
- y = op[1];
102
- op = [0];
103
- continue;
104
- case 7:
105
- op = _.ops.pop();
106
- _.trys.pop();
107
- continue;
108
- default:
109
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
110
- _ = 0;
111
- continue;
112
- }
113
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
114
- _.label = op[1];
115
- break;
116
- }
117
- if (op[0] === 6 && _.label < t[1]) {
118
- _.label = t[1];
119
- t = op;
120
- break;
121
- }
122
- if (t && _.label < t[2]) {
123
- _.label = t[2];
124
- _.ops.push(op);
125
- break;
126
- }
127
- if (t[2]) _.ops.pop();
128
- _.trys.pop();
129
- continue;
130
- }
131
- op = body.call(thisArg, _);
132
- } catch (e) {
133
- op = [6, e];
134
- y = 0;
135
- } finally {
136
- f = t = 0;
137
- }
138
- if (op[0] & 5) throw op[1];
139
- return {
140
- value: op[0] ? op[1] : void 0,
141
- done: true
142
- };
143
- }
144
- }
145
- var Graphics$4 = function (_super) {
146
- __extends(Graphics, _super);
147
- function Graphics() {
148
- return _super !== null && _super.apply(this, arguments) || this;
52
+ let Graphics = class Graphics extends pluginRenderer.Renderer {
53
+ constructor() {
54
+ super(...arguments);
55
+ this.name = 'Graphics';
149
56
  }
150
- return Graphics;
151
- }(pixi_js.Graphics);
152
- var GraphicsEngine = Graphics$4;
153
- var Graphics$2 = function (_super) {
154
- __extends(Graphics, _super);
155
- function Graphics() {
156
- var _this = _super !== null && _super.apply(this, arguments) || this;
157
- _this.graphics = null;
158
- return _this;
159
- }
160
- Graphics.prototype.init = function () {
161
- this.graphics = new GraphicsEngine();
162
- };
163
- Graphics.componentName = 'Graphics';
164
- return Graphics;
165
- }(eva_js.Component);
166
- var Graphics$3 = Graphics$2;
167
- var Graphics = function (_super) {
168
- __extends(Graphics, _super);
169
- function Graphics() {
170
- var _this = _super !== null && _super.apply(this, arguments) || this;
171
- _this.name = 'Graphics';
172
- return _this;
173
- }
174
- Graphics.prototype.init = function () {
57
+ init() {
175
58
  this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
176
59
  this.renderSystem.rendererManager.register(this);
177
- };
178
- Graphics.prototype.componentChanged = function (changed) {
179
- return __awaiter(this, void 0, void 0, function () {
180
- return __generator(this, function (_a) {
181
- if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
182
- this.containerManager.getContainer(changed.gameObject.id).addChildAt(changed.component.graphics, 0);
183
- } else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
184
- this.containerManager.getContainer(changed.gameObject.id).removeChild(changed.component.graphics);
185
- changed.component.graphics.destroy({
186
- children: true
187
- });
188
- }
189
- return [2];
190
- });
60
+ }
61
+ componentChanged(changed) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
64
+ this.containerManager.getContainer(changed.gameObject.id).addChildAt(changed.component.graphics, 0);
65
+ } else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
66
+ this.containerManager.getContainer(changed.gameObject.id).removeChild(changed.component.graphics);
67
+ changed.component.graphics.destroy({
68
+ children: true
69
+ });
70
+ }
191
71
  });
192
- };
193
- Graphics.systemName = 'Graphics';
194
- Graphics = __decorate([eva_js.decorators.componentObserver({
195
- Graphics: ['graphics']
196
- })], Graphics);
197
- return Graphics;
198
- }(pluginRenderer.Renderer);
72
+ }
73
+ };
74
+ Graphics.systemName = 'Graphics';
75
+ Graphics = __decorate([eva_js.decorators.componentObserver({
76
+ Graphics: ['graphics']
77
+ })], Graphics);
199
78
  var Graphics$1 = Graphics;
200
- exports.Graphics = Graphics$3;
79
+ exports.Graphics = Graphics$2;
201
80
  exports.GraphicsSystem = Graphics$1;
202
81
  Object.defineProperty(exports, '__esModule', {
203
82
  value: true
@@ -1 +1 @@
1
- window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_graphics=function(e,n,t,r){"use strict";var o=function(e,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])},o(e,n)};function i(e,n){function t(){this.constructor=e}o(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}function c(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,a)}u((r=r.apply(e,n||[])).next())}))}function a(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=n.call(e,c)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var u=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i(n,e),n}(t.Graphics),p=u,s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.graphics=null,n}return i(n,e),n.prototype.init=function(){this.graphics=new p},n.componentName="Graphics",n}(n.Component),l=s,f=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.name="Graphics",n}return i(t,e),t.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},t.prototype.componentChanged=function(e){return c(this,void 0,void 0,(function(){return a(this,(function(t){return e.type===n.OBSERVER_TYPE.ADD?this.containerManager.getContainer(e.gameObject.id).addChildAt(e.component.graphics,0):e.type===n.OBSERVER_TYPE.REMOVE&&(this.containerManager.getContainer(e.gameObject.id).removeChild(e.component.graphics),e.component.graphics.destroy({children:!0})),[2]}))}))},t.systemName="Graphics",t=function(e,n,t,r){var o,i=arguments.length,c=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,n,t,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(c=(i<3?o(c):i>3?o(n,t,c):o(n,t))||c);return i>3&&c&&Object.defineProperty(n,t,c),c}([n.decorators.componentObserver({Graphics:["graphics"]})],t),t}(r.Renderer),h=f;return e.Graphics=l,e.GraphicsSystem=h,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,PIXI,EVA.plugin.renderer);window.EVA.plugin.renderer.graphics=window.EVA.plugin.renderer.graphics||_EVA_IIFE_graphics;
1
+ window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_graphics=function(e,n,r,t){"use strict";class i extends r.Graphics{}class c extends n.Component{constructor(){super(...arguments),this.graphics=null}init(){this.graphics=new i}}function o(e,n,r,t){return new(r||(r=Promise))((function(i,c){function o(e){try{a(t.next(e))}catch(e){c(e)}}function s(e){try{a(t.throw(e))}catch(e){c(e)}}function a(e){var n;e.done?i(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(o,s)}a((t=t.apply(e,n||[])).next())}))}c.componentName="Graphics";let s=class extends t.Renderer{constructor(){super(...arguments),this.name="Graphics"}init(){this.renderSystem=this.game.getSystem(t.RendererSystem),this.renderSystem.rendererManager.register(this)}componentChanged(e){return o(this,void 0,void 0,(function*(){e.type===n.OBSERVER_TYPE.ADD?this.containerManager.getContainer(e.gameObject.id).addChildAt(e.component.graphics,0):e.type===n.OBSERVER_TYPE.REMOVE&&(this.containerManager.getContainer(e.gameObject.id).removeChild(e.component.graphics),e.component.graphics.destroy({children:!0}))}))}};s.systemName="Graphics",s=function(e,n,r,t){var i,c=arguments.length,o=c<3?n:null===t?t=Object.getOwnPropertyDescriptor(n,r):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,n,r,t);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(c<3?i(o):c>3?i(n,r,o):i(n,r))||o);return c>3&&o&&Object.defineProperty(n,r,o),o}([n.decorators.componentObserver({Graphics:["graphics"]})],s);var a=s;return e.Graphics=c,e.GraphicsSystem=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,PIXI,EVA.plugin.renderer);window.EVA.plugin.renderer.graphics=window.EVA.plugin.renderer.graphics||_EVA_IIFE_graphics;
@@ -6,6 +6,20 @@ var eva_js = require('@eva/eva.js');
6
6
  var pixi_js = require('pixi.js');
7
7
  var pluginRenderer = require('@eva/plugin-renderer');
8
8
 
9
+ class Graphics$3 extends pixi_js.Graphics {
10
+ }
11
+
12
+ class Graphics$2 extends eva_js.Component {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.graphics = null;
16
+ }
17
+ init() {
18
+ this.graphics = new Graphics$3();
19
+ }
20
+ }
21
+ Graphics$2.componentName = 'Graphics';
22
+
9
23
  /*! *****************************************************************************
10
24
  Copyright (c) Microsoft Corporation. All rights reserved.
11
25
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -20,20 +34,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
20
34
  See the Apache Version 2.0 License for specific language governing permissions
21
35
  and limitations under the License.
22
36
  ***************************************************************************** */
23
- /* global Reflect, Promise */
24
-
25
- var extendStatics = function(d, b) {
26
- extendStatics = Object.setPrototypeOf ||
27
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
28
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
29
- return extendStatics(d, b);
30
- };
31
-
32
- function __extends(d, b) {
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
37
 
38
38
  function __decorate(decorators, target, key, desc) {
39
39
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -49,98 +49,40 @@ function __awaiter(thisArg, _arguments, P, generator) {
49
49
  function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
50
50
  step((generator = generator.apply(thisArg, _arguments || [])).next());
51
51
  });
52
- }
53
-
54
- function __generator(thisArg, body) {
55
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
56
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
57
- function verb(n) { return function (v) { return step([n, v]); }; }
58
- function step(op) {
59
- if (f) throw new TypeError("Generator is already executing.");
60
- while (_) try {
61
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
62
- if (y = 0, t) op = [op[0] & 2, t.value];
63
- switch (op[0]) {
64
- case 0: case 1: t = op; break;
65
- case 4: _.label++; return { value: op[1], done: false };
66
- case 5: _.label++; y = op[1]; op = [0]; continue;
67
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
68
- default:
69
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
70
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
71
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
72
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
73
- if (t[2]) _.ops.pop();
74
- _.trys.pop(); continue;
75
- }
76
- op = body.call(thisArg, _);
77
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
78
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
79
- }
80
52
  }
81
53
 
82
- var Graphics$4 = (function (_super) {
83
- __extends(Graphics, _super);
84
- function Graphics() {
85
- return _super !== null && _super.apply(this, arguments) || this;
86
- }
87
- return Graphics;
88
- }(pixi_js.Graphics));
89
- var GraphicsEngine = Graphics$4;
90
-
91
- var Graphics$2 = (function (_super) {
92
- __extends(Graphics, _super);
93
- function Graphics() {
94
- var _this = _super !== null && _super.apply(this, arguments) || this;
95
- _this.graphics = null;
96
- return _this;
97
- }
98
- Graphics.prototype.init = function () {
99
- this.graphics = new GraphicsEngine();
100
- };
101
- Graphics.componentName = 'Graphics';
102
- return Graphics;
103
- }(eva_js.Component));
104
- var Graphics$3 = Graphics$2;
105
-
106
- var Graphics = (function (_super) {
107
- __extends(Graphics, _super);
108
- function Graphics() {
109
- var _this = _super !== null && _super.apply(this, arguments) || this;
110
- _this.name = 'Graphics';
111
- return _this;
54
+ let Graphics = class Graphics extends pluginRenderer.Renderer {
55
+ constructor() {
56
+ super(...arguments);
57
+ this.name = 'Graphics';
112
58
  }
113
- Graphics.prototype.init = function () {
59
+ init() {
114
60
  this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
115
61
  this.renderSystem.rendererManager.register(this);
116
- };
117
- Graphics.prototype.componentChanged = function (changed) {
118
- return __awaiter(this, void 0, void 0, function () {
119
- return __generator(this, function (_a) {
120
- if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
121
- this.containerManager
122
- .getContainer(changed.gameObject.id)
123
- .addChildAt(changed.component.graphics, 0);
124
- }
125
- else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
126
- this.containerManager
127
- .getContainer(changed.gameObject.id)
128
- .removeChild(changed.component.graphics);
129
- changed.component.graphics.destroy({ children: true });
130
- }
131
- return [2];
132
- });
62
+ }
63
+ componentChanged(changed) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
66
+ this.containerManager
67
+ .getContainer(changed.gameObject.id)
68
+ .addChildAt(changed.component.graphics, 0);
69
+ }
70
+ else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
71
+ this.containerManager
72
+ .getContainer(changed.gameObject.id)
73
+ .removeChild(changed.component.graphics);
74
+ changed.component.graphics.destroy({ children: true });
75
+ }
133
76
  });
134
- };
135
- Graphics.systemName = 'Graphics';
136
- Graphics = __decorate([
137
- eva_js.decorators.componentObserver({
138
- Graphics: ['graphics'],
139
- })
140
- ], Graphics);
141
- return Graphics;
142
- }(pluginRenderer.Renderer));
77
+ }
78
+ };
79
+ Graphics.systemName = 'Graphics';
80
+ Graphics = __decorate([
81
+ eva_js.decorators.componentObserver({
82
+ Graphics: ['graphics'],
83
+ })
84
+ ], Graphics);
143
85
  var Graphics$1 = Graphics;
144
86
 
145
- exports.Graphics = Graphics$3;
87
+ exports.Graphics = Graphics$2;
146
88
  exports.GraphicsSystem = Graphics$1;
@@ -1 +1,16 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("pixi.js"),n=require("@eva/plugin-renderer"),r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function i(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(t.Graphics),a=c,u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.graphics=null,t}return o(t,e),t.prototype.init=function(){this.graphics=new a},t.componentName="Graphics",t}(e.Component),s=u,p=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Graphics",e}return o(r,t),r.prototype.init=function(){this.renderSystem=this.game.getSystem(n.RendererSystem),this.renderSystem.rendererManager.register(this)},r.prototype.componentChanged=function(t){return n=this,r=void 0,c=function(){return i(this,(function(n){return t.type===e.OBSERVER_TYPE.ADD?this.containerManager.getContainer(t.gameObject.id).addChildAt(t.component.graphics,0):t.type===e.OBSERVER_TYPE.REMOVE&&(this.containerManager.getContainer(t.gameObject.id).removeChild(t.component.graphics),t.component.graphics.destroy({children:!0})),[2]}))},new((o=void 0)||(o=Promise))((function(e,t){function i(e){try{u(c.next(e))}catch(e){t(e)}}function a(e){try{u(c.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new o((function(e){e(t.value)})).then(i,a)}u((c=c.apply(n,r||[])).next())}));var n,r,o,c},r.systemName="Graphics",r=function(e,t,n,r){var o,i=arguments.length,c=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(c=(i<3?o(c):i>3?o(t,n,c):o(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}([e.decorators.componentObserver({Graphics:["graphics"]})],r),r}(n.Renderer);exports.Graphics=s,exports.GraphicsSystem=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("pixi.js"),r=require("@eva/plugin-renderer");class n extends t.Graphics{}class i extends e.Component{constructor(){super(...arguments),this.graphics=null}init(){this.graphics=new n}}i.componentName="Graphics";let s=class extends r.Renderer{constructor(){super(...arguments),this.name="Graphics"}init(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)}componentChanged(t){return r=this,n=void 0,s=function*(){t.type===e.OBSERVER_TYPE.ADD?this.containerManager.getContainer(t.gameObject.id).addChildAt(t.component.graphics,0):t.type===e.OBSERVER_TYPE.REMOVE&&(this.containerManager.getContainer(t.gameObject.id).removeChild(t.component.graphics),t.component.graphics.destroy({children:!0}))},new((i=void 0)||(i=Promise))((function(e,t){function c(e){try{a(s.next(e))}catch(e){t(e)}}function o(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){t.done?e(t.value):new i((function(e){e(t.value)})).then(c,o)}a((s=s.apply(r,n||[])).next())}));var r,n,i,s}};s.systemName="Graphics",s=
2
+ /*! *****************************************************************************
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
4
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
+ this file except in compliance with the License. You may obtain a copy of the
6
+ License at http://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11
+ MERCHANTABLITY OR NON-INFRINGEMENT.
12
+
13
+ See the Apache Version 2.0 License for specific language governing permissions
14
+ and limitations under the License.
15
+ ***************************************************************************** */
16
+ function(e,t,r,n){var i,s=arguments.length,c=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(c=(s<3?i(c):s>3?i(t,r,c):i(t,r))||c);return s>3&&c&&Object.defineProperty(t,r,c),c}([e.decorators.componentObserver({Graphics:["graphics"]})],s);var c=s;exports.Graphics=i,exports.GraphicsSystem=c;
@@ -1,6 +1,20 @@
1
1
  import { Component, decorators, OBSERVER_TYPE } from '@eva/eva.js';
2
- import { Graphics as Graphics$5 } from 'pixi.js';
3
- import { RendererSystem, Renderer } from '@eva/plugin-renderer';
2
+ import { Graphics as Graphics$4 } from 'pixi.js';
3
+ import { Renderer, RendererSystem } from '@eva/plugin-renderer';
4
+
5
+ class Graphics$3 extends Graphics$4 {
6
+ }
7
+
8
+ class Graphics$2 extends Component {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.graphics = null;
12
+ }
13
+ init() {
14
+ this.graphics = new Graphics$3();
15
+ }
16
+ }
17
+ Graphics$2.componentName = 'Graphics';
4
18
 
5
19
  /*! *****************************************************************************
6
20
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -16,20 +30,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
16
30
  See the Apache Version 2.0 License for specific language governing permissions
17
31
  and limitations under the License.
18
32
  ***************************************************************************** */
19
- /* global Reflect, Promise */
20
-
21
- var extendStatics = function(d, b) {
22
- extendStatics = Object.setPrototypeOf ||
23
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
24
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
25
- return extendStatics(d, b);
26
- };
27
-
28
- function __extends(d, b) {
29
- extendStatics(d, b);
30
- function __() { this.constructor = d; }
31
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
32
- }
33
33
 
34
34
  function __decorate(decorators, target, key, desc) {
35
35
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -45,97 +45,39 @@ function __awaiter(thisArg, _arguments, P, generator) {
45
45
  function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
46
46
  step((generator = generator.apply(thisArg, _arguments || [])).next());
47
47
  });
48
- }
49
-
50
- function __generator(thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
- function verb(n) { return function (v) { return step([n, v]); }; }
54
- function step(op) {
55
- if (f) throw new TypeError("Generator is already executing.");
56
- while (_) try {
57
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
- if (y = 0, t) op = [op[0] & 2, t.value];
59
- switch (op[0]) {
60
- case 0: case 1: t = op; break;
61
- case 4: _.label++; return { value: op[1], done: false };
62
- case 5: _.label++; y = op[1]; op = [0]; continue;
63
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
- default:
65
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
- if (t[2]) _.ops.pop();
70
- _.trys.pop(); continue;
71
- }
72
- op = body.call(thisArg, _);
73
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
- }
76
48
  }
77
49
 
78
- var Graphics$4 = (function (_super) {
79
- __extends(Graphics, _super);
80
- function Graphics() {
81
- return _super !== null && _super.apply(this, arguments) || this;
82
- }
83
- return Graphics;
84
- }(Graphics$5));
85
- var GraphicsEngine = Graphics$4;
86
-
87
- var Graphics$2 = (function (_super) {
88
- __extends(Graphics, _super);
89
- function Graphics() {
90
- var _this = _super !== null && _super.apply(this, arguments) || this;
91
- _this.graphics = null;
92
- return _this;
93
- }
94
- Graphics.prototype.init = function () {
95
- this.graphics = new GraphicsEngine();
96
- };
97
- Graphics.componentName = 'Graphics';
98
- return Graphics;
99
- }(Component));
100
- var Graphics$3 = Graphics$2;
101
-
102
- var Graphics = (function (_super) {
103
- __extends(Graphics, _super);
104
- function Graphics() {
105
- var _this = _super !== null && _super.apply(this, arguments) || this;
106
- _this.name = 'Graphics';
107
- return _this;
50
+ let Graphics = class Graphics extends Renderer {
51
+ constructor() {
52
+ super(...arguments);
53
+ this.name = 'Graphics';
108
54
  }
109
- Graphics.prototype.init = function () {
55
+ init() {
110
56
  this.renderSystem = this.game.getSystem(RendererSystem);
111
57
  this.renderSystem.rendererManager.register(this);
112
- };
113
- Graphics.prototype.componentChanged = function (changed) {
114
- return __awaiter(this, void 0, void 0, function () {
115
- return __generator(this, function (_a) {
116
- if (changed.type === OBSERVER_TYPE.ADD) {
117
- this.containerManager
118
- .getContainer(changed.gameObject.id)
119
- .addChildAt(changed.component.graphics, 0);
120
- }
121
- else if (changed.type === OBSERVER_TYPE.REMOVE) {
122
- this.containerManager
123
- .getContainer(changed.gameObject.id)
124
- .removeChild(changed.component.graphics);
125
- changed.component.graphics.destroy({ children: true });
126
- }
127
- return [2];
128
- });
58
+ }
59
+ componentChanged(changed) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ if (changed.type === OBSERVER_TYPE.ADD) {
62
+ this.containerManager
63
+ .getContainer(changed.gameObject.id)
64
+ .addChildAt(changed.component.graphics, 0);
65
+ }
66
+ else if (changed.type === OBSERVER_TYPE.REMOVE) {
67
+ this.containerManager
68
+ .getContainer(changed.gameObject.id)
69
+ .removeChild(changed.component.graphics);
70
+ changed.component.graphics.destroy({ children: true });
71
+ }
129
72
  });
130
- };
131
- Graphics.systemName = 'Graphics';
132
- Graphics = __decorate([
133
- decorators.componentObserver({
134
- Graphics: ['graphics'],
135
- })
136
- ], Graphics);
137
- return Graphics;
138
- }(Renderer));
73
+ }
74
+ };
75
+ Graphics.systemName = 'Graphics';
76
+ Graphics = __decorate([
77
+ decorators.componentObserver({
78
+ Graphics: ['graphics'],
79
+ })
80
+ ], Graphics);
139
81
  var Graphics$1 = Graphics;
140
82
 
141
- export { Graphics$3 as Graphics, Graphics$1 as GraphicsSystem };
83
+ export { Graphics$2 as Graphics, Graphics$1 as GraphicsSystem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-graphics",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "@eva/plugin-renderer-graphics",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-graphics.esm.js",
@@ -18,7 +18,7 @@
18
18
  "license": "MIT",
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
- "@eva/plugin-renderer": "2.0.0-beta.1",
22
- "@eva/eva.js": "2.0.0-beta.1"
21
+ "@eva/plugin-renderer": "2.0.0-beta.2",
22
+ "@eva/eva.js": "2.0.0-beta.2"
23
23
  }
24
24
  }