@eva/plugin-renderer-graphics 1.2.7-editor.8 → 1.2.7-fix.4

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,12 +1,11 @@
1
1
  window.EVA = window.EVA || {};
2
2
  window.EVA.plugin = window.EVA.plugin || {};
3
3
  window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
4
-
5
4
  var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
6
5
  'use strict';
7
6
 
8
- var _extendStatics$ = function extendStatics$1(d, b) {
9
- _extendStatics$ = Object.setPrototypeOf || {
7
+ var _extendStatics = function extendStatics(d, b) {
8
+ _extendStatics = Object.setPrototypeOf || {
10
9
  __proto__: []
11
10
  } instanceof Array && function (d, b) {
12
11
  d.__proto__ = b;
@@ -15,37 +14,30 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
15
14
  if (b.hasOwnProperty(p)) d[p] = b[p];
16
15
  }
17
16
  };
18
-
19
- return _extendStatics$(d, b);
17
+ return _extendStatics(d, b);
20
18
  };
21
-
22
- function __extends$1(d, b) {
23
- _extendStatics$(d, b);
24
-
19
+ function __extends(d, b) {
20
+ _extendStatics(d, b);
25
21
  function __() {
26
22
  this.constructor = d;
27
23
  }
28
-
29
24
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
25
  }
31
-
32
26
  function __decorate(decorators, target, key, desc) {
33
27
  var c = arguments.length,
34
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
35
- d;
28
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
29
+ d;
36
30
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
37
31
  if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
38
32
  }
39
33
  return c > 3 && r && Object.defineProperty(target, key, r), r;
40
34
  }
41
-
42
35
  function __awaiter(thisArg, _arguments, P, generator) {
43
36
  function adopt(value) {
44
37
  return value instanceof P ? value : new P(function (resolve) {
45
38
  resolve(value);
46
39
  });
47
40
  }
48
-
49
41
  return new (P || (P = Promise))(function (resolve, reject) {
50
42
  function fulfilled(value) {
51
43
  try {
@@ -54,7 +46,6 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
54
46
  reject(e);
55
47
  }
56
48
  }
57
-
58
49
  function rejected(value) {
59
50
  try {
60
51
  step(generator["throw"](value));
@@ -62,29 +53,26 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
62
53
  reject(e);
63
54
  }
64
55
  }
65
-
66
56
  function step(result) {
67
57
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
68
58
  }
69
-
70
59
  step((generator = generator.apply(thisArg, _arguments || [])).next());
71
60
  });
72
61
  }
73
-
74
62
  function __generator(thisArg, body) {
75
63
  var _ = {
76
- label: 0,
77
- sent: function sent() {
78
- if (t[0] & 1) throw t[1];
79
- return t[1];
64
+ label: 0,
65
+ sent: function sent() {
66
+ if (t[0] & 1) throw t[1];
67
+ return t[1];
68
+ },
69
+ trys: [],
70
+ ops: []
80
71
  },
81
- trys: [],
82
- ops: []
83
- },
84
- f,
85
- y,
86
- t,
87
- g;
72
+ f,
73
+ y,
74
+ t,
75
+ g;
88
76
  return g = {
89
77
  next: verb(0),
90
78
  "throw": verb(1),
@@ -92,79 +80,60 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
92
80
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
93
81
  return this;
94
82
  }), g;
95
-
96
83
  function verb(n) {
97
84
  return function (v) {
98
85
  return step([n, v]);
99
86
  };
100
87
  }
101
-
102
88
  function step(op) {
103
89
  if (f) throw new TypeError("Generator is already executing.");
104
-
105
90
  while (_) {
106
91
  try {
107
92
  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;
108
93
  if (y = 0, t) op = [op[0] & 2, t.value];
109
-
110
94
  switch (op[0]) {
111
95
  case 0:
112
96
  case 1:
113
97
  t = op;
114
98
  break;
115
-
116
99
  case 4:
117
100
  _.label++;
118
101
  return {
119
102
  value: op[1],
120
103
  done: false
121
104
  };
122
-
123
105
  case 5:
124
106
  _.label++;
125
107
  y = op[1];
126
108
  op = [0];
127
109
  continue;
128
-
129
110
  case 7:
130
111
  op = _.ops.pop();
131
-
132
112
  _.trys.pop();
133
-
134
113
  continue;
135
-
136
114
  default:
137
115
  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
138
116
  _ = 0;
139
117
  continue;
140
118
  }
141
-
142
119
  if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
143
120
  _.label = op[1];
144
121
  break;
145
122
  }
146
-
147
123
  if (op[0] === 6 && _.label < t[1]) {
148
124
  _.label = t[1];
149
125
  t = op;
150
126
  break;
151
127
  }
152
-
153
128
  if (t && _.label < t[2]) {
154
129
  _.label = t[2];
155
-
156
130
  _.ops.push(op);
157
-
158
131
  break;
159
132
  }
160
-
161
133
  if (t[2]) _.ops.pop();
162
-
163
134
  _.trys.pop();
164
-
165
135
  continue;
166
136
  }
167
-
168
137
  op = body.call(thisArg, _);
169
138
  } catch (e) {
170
139
  op = [6, e];
@@ -173,7 +142,6 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
173
142
  f = t = 0;
174
143
  }
175
144
  }
176
-
177
145
  if (op[0] & 5) throw op[1];
178
146
  return {
179
147
  value: op[0] ? op[1] : void 0,
@@ -181,249 +149,39 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
181
149
  };
182
150
  }
183
151
  }
184
-
185
- var _extendStatics = function extendStatics(d, b) {
186
- _extendStatics = Object.setPrototypeOf || {
187
- __proto__: []
188
- } instanceof Array && function (d, b) {
189
- d.__proto__ = b;
190
- } || function (d, b) {
191
- for (var p in b) {
192
- if (b.hasOwnProperty(p)) d[p] = b[p];
193
- }
194
- };
195
-
196
- return _extendStatics(d, b);
197
- };
198
-
199
- function __extends(d, b) {
200
- _extendStatics(d, b);
201
-
202
- function __() {
203
- this.constructor = d;
204
- }
205
-
206
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
207
- }
208
-
209
- (function (_super) {
210
- __extends(Application, _super);
211
-
212
- function Application(params) {
213
- var _this = this;
214
-
215
- params.autoStart = false;
216
- _this = _super.call(this, params) || this;
217
- return _this;
218
- }
219
-
220
- return Application;
221
- })(pixi_js.Application);
222
-
223
- (function (_super) {
224
- __extends(Container, _super);
225
-
226
- function Container() {
227
- return _super !== null && _super.apply(this, arguments) || this;
228
- }
229
-
230
- return Container;
231
- })(pixi_js.Container);
232
-
233
152
  var Graphics$4 = function (_super) {
234
153
  __extends(Graphics, _super);
235
-
236
154
  function Graphics() {
237
155
  return _super !== null && _super.apply(this, arguments) || this;
238
156
  }
239
-
240
157
  return Graphics;
241
158
  }(pixi_js.Graphics);
242
-
243
- var Graphics$1$1 = Graphics$4;
244
-
245
- (function (_super) {
246
- __extends(NinePatch, _super);
247
-
248
- function NinePatch(img, leftWidth, topHeight, rightWidth, bottomHeight) {
249
- var _this = this;
250
-
251
- var texture;
252
-
253
- if (img === 'string') {
254
- texture = pixi_js.Texture.fromFrame(img);
255
- } else {
256
- texture = pixi_js.Texture.from(img);
257
- }
258
-
259
- _this = _super.call(this, texture, leftWidth, topHeight, rightWidth, bottomHeight) || this;
260
- return _this;
261
- }
262
-
263
- return NinePatch;
264
- })(pixi_js.mesh.NineSlicePlane);
265
-
266
- (function () {
267
- function Sprite(image) {
268
- this._image = null;
269
- this._image = image;
270
-
271
- if (image) {
272
- if (image instanceof HTMLImageElement) {
273
- this.sprite = pixi_js.Sprite.from(image);
274
- } else if (image instanceof pixi_js.Texture) {
275
- this.sprite = new pixi_js.Sprite(image);
276
- }
277
- } else {
278
- this.sprite = new pixi_js.Sprite();
279
- }
280
- }
281
-
282
- Object.defineProperty(Sprite.prototype, "image", {
283
- get: function get() {
284
- return this._image;
285
- },
286
- set: function set(val) {
287
- if (this._image === val) {
288
- return;
289
- }
290
-
291
- if (val instanceof HTMLImageElement) {
292
- this.sprite.texture && this.sprite.texture.destroy(false);
293
- this.sprite.texture = pixi_js.Texture.from(val);
294
- } else if (val instanceof pixi_js.Texture) {
295
- this.sprite.texture = val;
296
- }
297
-
298
- this._image = val;
299
- },
300
- enumerable: false,
301
- configurable: true
302
- });
303
- return Sprite;
304
- })();
305
-
306
- (function () {
307
- function SpriteAnimation(_a) {
308
- var frames = _a.frames;
309
- this.animatedSprite = new pixi_js.extras.AnimatedSprite(frames);
310
- }
311
-
312
- SpriteAnimation.prototype.play = function () {
313
- this.animatedSprite.play();
314
- };
315
-
316
- SpriteAnimation.prototype.stop = function () {
317
- this.animatedSprite.stop();
318
- };
319
-
320
- SpriteAnimation.prototype.gotoAndPlay = function (frameNumber) {
321
- this.animatedSprite.gotoAndPlay(frameNumber);
322
- };
323
-
324
- SpriteAnimation.prototype.gotoAndStop = function (frameNumber) {
325
- this.animatedSprite.gotoAndStop(frameNumber);
326
- };
327
-
328
- Object.defineProperty(SpriteAnimation.prototype, "speed", {
329
- get: function get() {
330
- return this.animatedSprite.animationSpeed;
331
- },
332
- set: function set(val) {
333
- this.animatedSprite.animationSpeed = val;
334
- },
335
- enumerable: false,
336
- configurable: true
337
- });
338
- return SpriteAnimation;
339
- })();
340
-
341
- (function (_super) {
342
- __extends(Text, _super);
343
-
344
- function Text(text, style) {
345
- return _super.call(this, text, style) || this;
346
- }
347
-
348
- return Text;
349
- })(pixi_js.Text);
350
-
351
- var PIXITilingSprite = pixi_js.extras.TilingSprite;
352
-
353
- (function () {
354
- function TilingSprite(image) {
355
- this._image = null;
356
- this._image = image;
357
-
358
- if (image) {
359
- if (image instanceof HTMLImageElement) {
360
- this.tilingSprite = new PIXITilingSprite(pixi_js.Texture.from(image));
361
- } else if (image instanceof pixi_js.Texture) {
362
- this.tilingSprite = new PIXITilingSprite(image);
363
- }
364
- } else {
365
- this.tilingSprite = new PIXITilingSprite(pixi_js.Texture.EMPTY);
366
- }
367
- }
368
-
369
- Object.defineProperty(TilingSprite.prototype, "image", {
370
- get: function get() {
371
- return this._image;
372
- },
373
- set: function set(val) {
374
- if (this._image === val) {
375
- return;
376
- }
377
-
378
- if (val instanceof HTMLImageElement) {
379
- this.tilingSprite.texture = pixi_js.Texture.from(val);
380
- } else if (val instanceof pixi_js.Texture) {
381
- this.tilingSprite.texture = val;
382
- }
383
-
384
- this._image = val;
385
- },
386
- enumerable: false,
387
- configurable: true
388
- });
389
- return TilingSprite;
390
- })();
391
-
159
+ var GraphicsEngine = Graphics$4;
392
160
  var Graphics$2 = function (_super) {
393
- __extends$1(Graphics, _super);
394
-
161
+ __extends(Graphics, _super);
395
162
  function Graphics() {
396
163
  var _this = _super !== null && _super.apply(this, arguments) || this;
397
-
398
164
  _this.graphics = null;
399
165
  return _this;
400
166
  }
401
-
402
167
  Graphics.prototype.init = function () {
403
- this.graphics = new Graphics$1$1();
168
+ this.graphics = new GraphicsEngine();
404
169
  };
405
-
406
170
  Graphics.componentName = 'Graphics';
407
171
  return Graphics;
408
172
  }(eva_js.Component);
409
-
410
173
  var Graphics$3 = Graphics$2;
411
-
412
174
  var Graphics = function (_super) {
413
- __extends$1(Graphics, _super);
414
-
175
+ __extends(Graphics, _super);
415
176
  function Graphics() {
416
177
  var _this = _super !== null && _super.apply(this, arguments) || this;
417
-
418
178
  _this.name = 'Graphics';
419
179
  return _this;
420
180
  }
421
-
422
181
  Graphics.prototype.init = function () {
423
182
  this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
424
183
  this.renderSystem.rendererManager.register(this);
425
184
  };
426
-
427
185
  Graphics.prototype.componentChanged = function (changed) {
428
186
  return __awaiter(this, void 0, void 0, function () {
429
187
  return __generator(this, function (_a) {
@@ -435,19 +193,16 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
435
193
  children: true
436
194
  });
437
195
  }
438
-
439
196
  return [2];
440
197
  });
441
198
  });
442
199
  };
443
-
444
200
  Graphics.systemName = 'Graphics';
445
201
  Graphics = __decorate([eva_js.decorators.componentObserver({
446
202
  Graphics: ['graphics']
447
203
  })], Graphics);
448
204
  return Graphics;
449
205
  }(pluginRenderer.Renderer);
450
-
451
206
  var Graphics$1 = Graphics;
452
207
  exports.Graphics = Graphics$3;
453
208
  exports.GraphicsSystem = Graphics$1;
@@ -456,5 +211,4 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
456
211
  });
457
212
  return exports;
458
213
  }({}, EVA, PIXI, EVA.plugin.renderer);
459
-
460
214
  window.EVA.plugin.renderer.graphics = window.EVA.plugin.renderer.graphics || _EVA_IIFE_graphics;
@@ -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(t,e,n,r){"use strict";var i=function(t,e){return i=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])},i(t,e)};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function c(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}var u=function(t,e){return u=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])},u(t,e)};function p(t,e){function n(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}!function(t){function e(e){return e.autoStart=!1,t.call(this,e)||this}p(e,t)}(n.Application),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}p(e,t)}(n.Container);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e}(n.Graphics),f=s;!function(t){function e(e,r,i,o,a){var c;return c="string"===e?n.Texture.fromFrame(e):n.Texture.from(e),t.call(this,c,r,i,o,a)||this}p(e,t)}(n.mesh.NineSlicePlane),function(){function t(t){this._image=null,this._image=t,t?t instanceof HTMLImageElement?this.sprite=n.Sprite.from(t):t instanceof n.Texture&&(this.sprite=new n.Sprite(t)):this.sprite=new n.Sprite}Object.defineProperty(t.prototype,"image",{get:function(){return this._image},set:function(t){this._image!==t&&(t instanceof HTMLImageElement?(this.sprite.texture&&this.sprite.texture.destroy(!1),this.sprite.texture=n.Texture.from(t)):t instanceof n.Texture&&(this.sprite.texture=t),this._image=t)},enumerable:!1,configurable:!0})}(),function(){function t(t){var e=t.frames;this.animatedSprite=new n.extras.AnimatedSprite(e)}t.prototype.play=function(){this.animatedSprite.play()},t.prototype.stop=function(){this.animatedSprite.stop()},t.prototype.gotoAndPlay=function(t){this.animatedSprite.gotoAndPlay(t)},t.prototype.gotoAndStop=function(t){this.animatedSprite.gotoAndStop(t)},Object.defineProperty(t.prototype,"speed",{get:function(){return this.animatedSprite.animationSpeed},set:function(t){this.animatedSprite.animationSpeed=t},enumerable:!1,configurable:!0})}(),function(t){function e(e,n){return t.call(this,e,n)||this}p(e,t)}(n.Text);var l=n.extras.TilingSprite;!function(){function t(t){this._image=null,this._image=t,t?t instanceof HTMLImageElement?this.tilingSprite=new l(n.Texture.from(t)):t instanceof n.Texture&&(this.tilingSprite=new l(t)):this.tilingSprite=new l(n.Texture.EMPTY)}Object.defineProperty(t.prototype,"image",{get:function(){return this._image},set:function(t){this._image!==t&&(t instanceof HTMLImageElement?this.tilingSprite.texture=n.Texture.from(t):t instanceof n.Texture&&(this.tilingSprite.texture=t),this._image=t)},enumerable:!1,configurable:!0})}();var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.graphics=null,e}return o(e,t),e.prototype.init=function(){this.graphics=new f},e.componentName="Graphics",e}(e.Component),g=h,m=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Graphics",e}return o(n,t),n.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},n.prototype.componentChanged=function(t){return a(this,void 0,void 0,(function(){return c(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]}))}))},n.systemName="Graphics",n=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([e.decorators.componentObserver({Graphics:["graphics"]})],n),n}(r.Renderer),y=m;return t.Graphics=g,t.GraphicsSystem=y,Object.defineProperty(t,"__esModule",{value:!0}),t}({},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,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;
@@ -0,0 +1,52 @@
1
+ import { __extends, __awaiter, __generator, __decorate } from 'tslib';
2
+ import { Component, OBSERVER_TYPE, decorators } from '@eva/eva.js/dist/miniprogram';
3
+ import { Graphics as Graphics$4 } from '@eva/renderer-adapter/dist/miniprogram';
4
+ import { RendererSystem, Renderer } from '@eva/plugin-renderer/dist/miniprogram';
5
+ var Graphics$2 = function (_super) {
6
+ __extends(Graphics, _super);
7
+ function Graphics() {
8
+ var _this = _super !== null && _super.apply(this, arguments) || this;
9
+ _this.graphics = null;
10
+ return _this;
11
+ }
12
+ Graphics.prototype.init = function () {
13
+ this.graphics = new Graphics$4();
14
+ };
15
+ Graphics.componentName = 'Graphics';
16
+ return Graphics;
17
+ }(Component);
18
+ var Graphics$3 = Graphics$2;
19
+ var Graphics = function (_super) {
20
+ __extends(Graphics, _super);
21
+ function Graphics() {
22
+ var _this = _super !== null && _super.apply(this, arguments) || this;
23
+ _this.name = 'Graphics';
24
+ return _this;
25
+ }
26
+ Graphics.prototype.init = function () {
27
+ this.renderSystem = this.game.getSystem(RendererSystem);
28
+ this.renderSystem.rendererManager.register(this);
29
+ };
30
+ Graphics.prototype.componentChanged = function (changed) {
31
+ return __awaiter(this, void 0, void 0, function () {
32
+ return __generator(this, function (_a) {
33
+ if (changed.type === OBSERVER_TYPE.ADD) {
34
+ this.containerManager.getContainer(changed.gameObject.id).addChildAt(changed.component.graphics, 0);
35
+ } else if (changed.type === OBSERVER_TYPE.REMOVE) {
36
+ this.containerManager.getContainer(changed.gameObject.id).removeChild(changed.component.graphics);
37
+ changed.component.graphics.destroy({
38
+ children: true
39
+ });
40
+ }
41
+ return [2];
42
+ });
43
+ });
44
+ };
45
+ Graphics.systemName = 'Graphics';
46
+ Graphics = __decorate([decorators.componentObserver({
47
+ Graphics: ['graphics']
48
+ })], Graphics);
49
+ return Graphics;
50
+ }(Renderer);
51
+ var Graphics$1 = Graphics;
52
+ export { Graphics$3 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": "1.2.7-editor.8",
3
+ "version": "1.2.7-fix.4",
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": "1.2.7-editor.8",
22
- "@eva/eva.js": "1.2.7-editor.8"
21
+ "@eva/plugin-renderer": "1.2.7-fix.4",
22
+ "@eva/eva.js": "1.2.7-fix.4"
23
23
  }
24
24
  }