@eva/plugin-renderer-graphics 1.2.7-editor.0 → 1.2.7-editor.3

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.
@@ -5,8 +5,8 @@ window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
5
5
  var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
6
6
  'use strict';
7
7
 
8
- var _extendStatics = function extendStatics(d, b) {
9
- _extendStatics = Object.setPrototypeOf || {
8
+ var _extendStatics$ = function extendStatics$1(d, b) {
9
+ _extendStatics$ = Object.setPrototypeOf || {
10
10
  __proto__: []
11
11
  } instanceof Array && function (d, b) {
12
12
  d.__proto__ = b;
@@ -16,11 +16,11 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
16
16
  }
17
17
  };
18
18
 
19
- return _extendStatics(d, b);
19
+ return _extendStatics$(d, b);
20
20
  };
21
21
 
22
- function __extends(d, b) {
23
- _extendStatics(d, b);
22
+ function __extends$1(d, b) {
23
+ _extendStatics$(d, b);
24
24
 
25
25
  function __() {
26
26
  this.constructor = d;
@@ -182,6 +182,54 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
182
182
  }
183
183
  }
184
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
+
185
233
  var Graphics$4 = function (_super) {
186
234
  __extends(Graphics, _super);
187
235
 
@@ -192,10 +240,157 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
192
240
  return Graphics;
193
241
  }(pixi_js.Graphics);
194
242
 
195
- var GraphicsEngine = Graphics$4;
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
+ })();
196
391
 
197
392
  var Graphics$2 = function (_super) {
198
- __extends(Graphics, _super);
393
+ __extends$1(Graphics, _super);
199
394
 
200
395
  function Graphics() {
201
396
  var _this = _super !== null && _super.apply(this, arguments) || this;
@@ -205,7 +400,7 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
205
400
  }
206
401
 
207
402
  Graphics.prototype.init = function () {
208
- this.graphics = new GraphicsEngine();
403
+ this.graphics = new Graphics$1$1();
209
404
  };
210
405
 
211
406
  Graphics.componentName = 'Graphics';
@@ -215,7 +410,7 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
215
410
  var Graphics$3 = Graphics$2;
216
411
 
217
412
  var Graphics = function (_super) {
218
- __extends(Graphics, _super);
413
+ __extends$1(Graphics, _super);
219
414
 
220
415
  function Graphics() {
221
416
  var _this = _super !== null && _super.apply(this, arguments) || this;
@@ -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])})(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=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 u},n.componentName="Graphics",n}(n.Component),s=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)}(r.Renderer);return e.Graphics=p,e.GraphicsSystem=s,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(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 +1 @@
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])})(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=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 c},t.componentName="Graphics",t}(e.Component),u=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)}(n.Renderer);exports.Graphics=a,exports.GraphicsSystem=u;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-graphics",
3
- "version": "1.2.7-editor.0",
3
+ "version": "1.2.7-editor.3",
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.0",
22
- "@eva/eva.js": "1.2.7-editor.0"
21
+ "@eva/plugin-renderer": "1.2.7-editor.3",
22
+ "@eva/eva.js": "1.2.7-editor.3"
23
23
  }
24
24
  }