@eva/renderer-adapter 1.2.7-editor.9 → 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,5 +1,4 @@
1
1
  window.EVA = window.EVA || {};
2
-
3
2
  var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
4
3
  'use strict';
5
4
 
@@ -13,88 +12,62 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
13
12
  if (b.hasOwnProperty(p)) d[p] = b[p];
14
13
  }
15
14
  };
16
-
17
15
  return _extendStatics(d, b);
18
16
  };
19
-
20
17
  function __extends(d, b) {
21
18
  _extendStatics(d, b);
22
-
23
19
  function __() {
24
20
  this.constructor = d;
25
21
  }
26
-
27
22
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
23
  }
29
-
30
24
  var Application = function (_super) {
31
25
  __extends(Application, _super);
32
-
33
26
  function Application(params) {
34
27
  var _this = this;
35
-
36
28
  params.autoStart = false;
37
29
  _this = _super.call(this, params) || this;
38
30
  return _this;
39
31
  }
40
-
41
32
  return Application;
42
33
  }(pixi_js.Application);
43
-
44
34
  var Application$1 = Application;
45
-
46
35
  var Container = function (_super) {
47
36
  __extends(Container, _super);
48
-
49
37
  function Container() {
50
38
  return _super !== null && _super.apply(this, arguments) || this;
51
39
  }
52
-
53
40
  return Container;
54
41
  }(pixi_js.Container);
55
-
56
42
  var Container$1 = Container;
57
-
58
43
  var Graphics = function (_super) {
59
44
  __extends(Graphics, _super);
60
-
61
45
  function Graphics() {
62
46
  return _super !== null && _super.apply(this, arguments) || this;
63
47
  }
64
-
65
48
  return Graphics;
66
49
  }(pixi_js.Graphics);
67
-
68
50
  var Graphics$1 = Graphics;
69
-
70
51
  var NinePatch = function (_super) {
71
52
  __extends(NinePatch, _super);
72
-
73
53
  function NinePatch(img, leftWidth, topHeight, rightWidth, bottomHeight) {
74
54
  var _this = this;
75
-
76
55
  var texture;
77
-
78
56
  if (img === 'string') {
79
57
  texture = pixi_js.Texture.fromFrame(img);
80
58
  } else {
81
59
  texture = pixi_js.Texture.from(img);
82
60
  }
83
-
84
61
  _this = _super.call(this, texture, leftWidth, topHeight, rightWidth, bottomHeight) || this;
85
62
  return _this;
86
63
  }
87
-
88
64
  return NinePatch;
89
65
  }(pixi_js.mesh.NineSlicePlane);
90
-
91
66
  var NinePatch$1 = NinePatch;
92
-
93
67
  var Sprite = function () {
94
68
  function Sprite(image) {
95
69
  this._image = null;
96
70
  this._image = image;
97
-
98
71
  if (image) {
99
72
  if (image instanceof HTMLImageElement) {
100
73
  this.sprite = pixi_js.Sprite.from(image);
@@ -105,7 +78,6 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
105
78
  this.sprite = new pixi_js.Sprite();
106
79
  }
107
80
  }
108
-
109
81
  Object.defineProperty(Sprite.prototype, "image", {
110
82
  get: function get() {
111
83
  return this._image;
@@ -114,14 +86,12 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
114
86
  if (this._image === val) {
115
87
  return;
116
88
  }
117
-
118
89
  if (val instanceof HTMLImageElement) {
119
90
  this.sprite.texture && this.sprite.texture.destroy(false);
120
91
  this.sprite.texture = pixi_js.Texture.from(val);
121
92
  } else if (val instanceof pixi_js.Texture) {
122
93
  this.sprite.texture = val;
123
94
  }
124
-
125
95
  this._image = val;
126
96
  },
127
97
  enumerable: false,
@@ -129,31 +99,24 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
129
99
  });
130
100
  return Sprite;
131
101
  }();
132
-
133
102
  var Sprite$1 = Sprite;
134
-
135
103
  var SpriteAnimation = function () {
136
104
  function SpriteAnimation(_a) {
137
105
  var frames = _a.frames;
138
106
  this.animatedSprite = new pixi_js.extras.AnimatedSprite(frames);
139
107
  }
140
-
141
108
  SpriteAnimation.prototype.play = function () {
142
109
  this.animatedSprite.play();
143
110
  };
144
-
145
111
  SpriteAnimation.prototype.stop = function () {
146
112
  this.animatedSprite.stop();
147
113
  };
148
-
149
114
  SpriteAnimation.prototype.gotoAndPlay = function (frameNumber) {
150
115
  this.animatedSprite.gotoAndPlay(frameNumber);
151
116
  };
152
-
153
117
  SpriteAnimation.prototype.gotoAndStop = function (frameNumber) {
154
118
  this.animatedSprite.gotoAndStop(frameNumber);
155
119
  };
156
-
157
120
  Object.defineProperty(SpriteAnimation.prototype, "speed", {
158
121
  get: function get() {
159
122
  return this.animatedSprite.animationSpeed;
@@ -166,27 +129,20 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
166
129
  });
167
130
  return SpriteAnimation;
168
131
  }();
169
-
170
132
  var SpriteAnimation$1 = SpriteAnimation;
171
-
172
133
  var Text = function (_super) {
173
134
  __extends(Text, _super);
174
-
175
135
  function Text(text, style) {
176
136
  return _super.call(this, text, style) || this;
177
137
  }
178
-
179
138
  return Text;
180
139
  }(pixi_js.Text);
181
-
182
140
  var Text$1 = Text;
183
141
  var PIXITilingSprite = pixi_js.extras.TilingSprite;
184
-
185
142
  var TilingSprite = function () {
186
143
  function TilingSprite(image) {
187
144
  this._image = null;
188
145
  this._image = image;
189
-
190
146
  if (image) {
191
147
  if (image instanceof HTMLImageElement) {
192
148
  this.tilingSprite = new PIXITilingSprite(pixi_js.Texture.from(image));
@@ -197,7 +153,6 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
197
153
  this.tilingSprite = new PIXITilingSprite(pixi_js.Texture.EMPTY);
198
154
  }
199
155
  }
200
-
201
156
  Object.defineProperty(TilingSprite.prototype, "image", {
202
157
  get: function get() {
203
158
  return this._image;
@@ -206,13 +161,11 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
206
161
  if (this._image === val) {
207
162
  return;
208
163
  }
209
-
210
164
  if (val instanceof HTMLImageElement) {
211
165
  this.tilingSprite.texture = pixi_js.Texture.from(val);
212
166
  } else if (val instanceof pixi_js.Texture) {
213
167
  this.tilingSprite.texture = val;
214
168
  }
215
-
216
169
  this._image = val;
217
170
  },
218
171
  enumerable: false,
@@ -220,7 +173,6 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
220
173
  });
221
174
  return TilingSprite;
222
175
  }();
223
-
224
176
  var TilingSprite$1 = TilingSprite;
225
177
  exports.Application = Application$1;
226
178
  exports.Container = Container$1;
@@ -235,5 +187,4 @@ var _EVA_IIFE_rendererAdapter = function (exports, pixi_js) {
235
187
  });
236
188
  return exports;
237
189
  }({}, PIXI);
238
-
239
190
  window.EVA.rendererAdapter = window.EVA.rendererAdapter || _EVA_IIFE_rendererAdapter;
@@ -0,0 +1,157 @@
1
+ import { __extends } from 'tslib';
2
+ import { Application as Application$2, Container as Container$2, Graphics as Graphics$2, Texture, mesh, Sprite as Sprite$2, extras, Text as Text$2 } from '@eva/miniprogram-pixi';
3
+ import { Image } from '@eva/miniprogram-adapter';
4
+ var Application = function (_super) {
5
+ __extends(Application, _super);
6
+ function Application(params) {
7
+ var _this = this;
8
+ params.autoStart = false;
9
+ _this = _super.call(this, params) || this;
10
+ return _this;
11
+ }
12
+ return Application;
13
+ }(Application$2);
14
+ var Application$1 = Application;
15
+ var Container = function (_super) {
16
+ __extends(Container, _super);
17
+ function Container() {
18
+ return _super !== null && _super.apply(this, arguments) || this;
19
+ }
20
+ return Container;
21
+ }(Container$2);
22
+ var Container$1 = Container;
23
+ var Graphics = function (_super) {
24
+ __extends(Graphics, _super);
25
+ function Graphics() {
26
+ return _super !== null && _super.apply(this, arguments) || this;
27
+ }
28
+ return Graphics;
29
+ }(Graphics$2);
30
+ var Graphics$1 = Graphics;
31
+ var NinePatch = function (_super) {
32
+ __extends(NinePatch, _super);
33
+ function NinePatch(img, leftWidth, topHeight, rightWidth, bottomHeight) {
34
+ var _this = this;
35
+ var texture;
36
+ if (img === 'string') {
37
+ texture = Texture.fromFrame(img);
38
+ } else {
39
+ texture = Texture.from(img);
40
+ }
41
+ _this = _super.call(this, texture, leftWidth, topHeight, rightWidth, bottomHeight) || this;
42
+ return _this;
43
+ }
44
+ return NinePatch;
45
+ }(mesh.NineSlicePlane);
46
+ var NinePatch$1 = NinePatch;
47
+ var Sprite = function () {
48
+ function Sprite(image) {
49
+ this._image = null;
50
+ this._image = image;
51
+ if (image) {
52
+ if (image instanceof Image) {
53
+ this.sprite = Sprite$2.from(image);
54
+ } else if (image instanceof Texture) {
55
+ this.sprite = new Sprite$2(image);
56
+ }
57
+ } else {
58
+ this.sprite = new Sprite$2();
59
+ }
60
+ }
61
+ Object.defineProperty(Sprite.prototype, "image", {
62
+ get: function get() {
63
+ return this._image;
64
+ },
65
+ set: function set(val) {
66
+ if (this._image === val) {
67
+ return;
68
+ }
69
+ if (val instanceof Image) {
70
+ this.sprite.texture && this.sprite.texture.destroy(false);
71
+ this.sprite.texture = Texture.from(val);
72
+ } else if (val instanceof Texture) {
73
+ this.sprite.texture = val;
74
+ }
75
+ this._image = val;
76
+ },
77
+ enumerable: false,
78
+ configurable: true
79
+ });
80
+ return Sprite;
81
+ }();
82
+ var Sprite$1 = Sprite;
83
+ var SpriteAnimation = function () {
84
+ function SpriteAnimation(_a) {
85
+ var frames = _a.frames;
86
+ this.animatedSprite = new extras.AnimatedSprite(frames);
87
+ }
88
+ SpriteAnimation.prototype.play = function () {
89
+ this.animatedSprite.play();
90
+ };
91
+ SpriteAnimation.prototype.stop = function () {
92
+ this.animatedSprite.stop();
93
+ };
94
+ SpriteAnimation.prototype.gotoAndPlay = function (frameNumber) {
95
+ this.animatedSprite.gotoAndPlay(frameNumber);
96
+ };
97
+ SpriteAnimation.prototype.gotoAndStop = function (frameNumber) {
98
+ this.animatedSprite.gotoAndStop(frameNumber);
99
+ };
100
+ Object.defineProperty(SpriteAnimation.prototype, "speed", {
101
+ get: function get() {
102
+ return this.animatedSprite.animationSpeed;
103
+ },
104
+ set: function set(val) {
105
+ this.animatedSprite.animationSpeed = val;
106
+ },
107
+ enumerable: false,
108
+ configurable: true
109
+ });
110
+ return SpriteAnimation;
111
+ }();
112
+ var SpriteAnimation$1 = SpriteAnimation;
113
+ var Text = function (_super) {
114
+ __extends(Text, _super);
115
+ function Text(text, style) {
116
+ return _super.call(this, text, style) || this;
117
+ }
118
+ return Text;
119
+ }(Text$2);
120
+ var Text$1 = Text;
121
+ var PIXITilingSprite = extras.TilingSprite;
122
+ var TilingSprite = function () {
123
+ function TilingSprite(image) {
124
+ this._image = null;
125
+ this._image = image;
126
+ if (image) {
127
+ if (image instanceof Image) {
128
+ this.tilingSprite = new PIXITilingSprite(Texture.from(image));
129
+ } else if (image instanceof Texture) {
130
+ this.tilingSprite = new PIXITilingSprite(image);
131
+ }
132
+ } else {
133
+ this.tilingSprite = new PIXITilingSprite(Texture.EMPTY);
134
+ }
135
+ }
136
+ Object.defineProperty(TilingSprite.prototype, "image", {
137
+ get: function get() {
138
+ return this._image;
139
+ },
140
+ set: function set(val) {
141
+ if (this._image === val) {
142
+ return;
143
+ }
144
+ if (val instanceof Image) {
145
+ this.tilingSprite.texture = Texture.from(val);
146
+ } else if (val instanceof Texture) {
147
+ this.tilingSprite.texture = val;
148
+ }
149
+ this._image = val;
150
+ },
151
+ enumerable: false,
152
+ configurable: true
153
+ });
154
+ return TilingSprite;
155
+ }();
156
+ var TilingSprite$1 = TilingSprite;
157
+ export { Application$1 as Application, Container$1 as Container, Graphics$1 as Graphics, NinePatch$1 as NinePatch, Sprite$1 as Sprite, SpriteAnimation$1 as SpriteAnimation, Text$1 as Text, TilingSprite$1 as TilingSprite };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/renderer-adapter",
3
- "version": "1.2.7-editor.9",
3
+ "version": "1.2.7-fix.4",
4
4
  "description": "@eva/renderer-adapter",
5
5
  "main": "index.js",
6
6
  "module": "dist/renderer-adapter.esm.js",