@eva/renderer-adapter 1.2.0 → 1.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
this.EVA = this.EVA || {};
|
|
2
|
+
|
|
3
|
+
this.EVA.rendererAdapter = function (exports, pixi_js) {
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
var _extendStatics = function extendStatics(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) {
|
|
13
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return _extendStatics(d, b);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function __extends(d, b) {
|
|
21
|
+
_extendStatics(d, b);
|
|
22
|
+
|
|
23
|
+
function __() {
|
|
24
|
+
this.constructor = d;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var Application = function (_super) {
|
|
31
|
+
__extends(Application, _super);
|
|
32
|
+
|
|
33
|
+
function Application(params) {
|
|
34
|
+
var _this = this;
|
|
35
|
+
|
|
36
|
+
params.autoStart = false;
|
|
37
|
+
_this = _super.call(this, params) || this;
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return Application;
|
|
42
|
+
}(pixi_js.Application);
|
|
43
|
+
|
|
44
|
+
var Application$1 = Application;
|
|
45
|
+
|
|
46
|
+
var Container = function (_super) {
|
|
47
|
+
__extends(Container, _super);
|
|
48
|
+
|
|
49
|
+
function Container() {
|
|
50
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return Container;
|
|
54
|
+
}(pixi_js.Container);
|
|
55
|
+
|
|
56
|
+
var Container$1 = Container;
|
|
57
|
+
|
|
58
|
+
var Graphics = function (_super) {
|
|
59
|
+
__extends(Graphics, _super);
|
|
60
|
+
|
|
61
|
+
function Graphics() {
|
|
62
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return Graphics;
|
|
66
|
+
}(pixi_js.Graphics);
|
|
67
|
+
|
|
68
|
+
var Graphics$1 = Graphics;
|
|
69
|
+
|
|
70
|
+
var NinePatch = function (_super) {
|
|
71
|
+
__extends(NinePatch, _super);
|
|
72
|
+
|
|
73
|
+
function NinePatch(img, leftWidth, topHeight, rightWidth, bottomHeight) {
|
|
74
|
+
var _this = this;
|
|
75
|
+
|
|
76
|
+
var texture;
|
|
77
|
+
|
|
78
|
+
if (img === 'string') {
|
|
79
|
+
texture = pixi_js.Texture.fromFrame(img);
|
|
80
|
+
} else {
|
|
81
|
+
texture = pixi_js.Texture.from(img);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
_this = _super.call(this, texture, leftWidth, topHeight, rightWidth, bottomHeight) || this;
|
|
85
|
+
return _this;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return NinePatch;
|
|
89
|
+
}(pixi_js.mesh.NineSlicePlane);
|
|
90
|
+
|
|
91
|
+
var NinePatch$1 = NinePatch;
|
|
92
|
+
|
|
93
|
+
var Sprite = function () {
|
|
94
|
+
function Sprite(image) {
|
|
95
|
+
this._image = null;
|
|
96
|
+
this._image = image;
|
|
97
|
+
|
|
98
|
+
if (image) {
|
|
99
|
+
if (image instanceof HTMLImageElement) {
|
|
100
|
+
this.sprite = pixi_js.Sprite.from(image);
|
|
101
|
+
} else if (image instanceof pixi_js.Texture) {
|
|
102
|
+
this.sprite = new pixi_js.Sprite(image);
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
this.sprite = new pixi_js.Sprite();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
Object.defineProperty(Sprite.prototype, "image", {
|
|
110
|
+
get: function get() {
|
|
111
|
+
return this._image;
|
|
112
|
+
},
|
|
113
|
+
set: function set(val) {
|
|
114
|
+
if (this._image === val) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (val instanceof HTMLImageElement) {
|
|
119
|
+
this.sprite.texture && this.sprite.texture.destroy(false);
|
|
120
|
+
this.sprite.texture = pixi_js.Texture.from(val);
|
|
121
|
+
} else if (val instanceof pixi_js.Texture) {
|
|
122
|
+
this.sprite.texture = val;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
this._image = val;
|
|
126
|
+
},
|
|
127
|
+
enumerable: false,
|
|
128
|
+
configurable: true
|
|
129
|
+
});
|
|
130
|
+
return Sprite;
|
|
131
|
+
}();
|
|
132
|
+
|
|
133
|
+
var Sprite$1 = Sprite;
|
|
134
|
+
|
|
135
|
+
var SpriteAnimation = function () {
|
|
136
|
+
function SpriteAnimation(_a) {
|
|
137
|
+
var frames = _a.frames;
|
|
138
|
+
this.animatedSprite = new pixi_js.extras.AnimatedSprite(frames);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
SpriteAnimation.prototype.play = function () {
|
|
142
|
+
this.animatedSprite.play();
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
SpriteAnimation.prototype.stop = function () {
|
|
146
|
+
this.animatedSprite.stop();
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
SpriteAnimation.prototype.gotoAndPlay = function (frameNumber) {
|
|
150
|
+
this.animatedSprite.gotoAndPlay(frameNumber);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
SpriteAnimation.prototype.gotoAndStop = function (frameNumber) {
|
|
154
|
+
this.animatedSprite.gotoAndStop(frameNumber);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
Object.defineProperty(SpriteAnimation.prototype, "speed", {
|
|
158
|
+
get: function get() {
|
|
159
|
+
return this.animatedSprite.animationSpeed;
|
|
160
|
+
},
|
|
161
|
+
set: function set(val) {
|
|
162
|
+
this.animatedSprite.animationSpeed = val;
|
|
163
|
+
},
|
|
164
|
+
enumerable: false,
|
|
165
|
+
configurable: true
|
|
166
|
+
});
|
|
167
|
+
return SpriteAnimation;
|
|
168
|
+
}();
|
|
169
|
+
|
|
170
|
+
var SpriteAnimation$1 = SpriteAnimation;
|
|
171
|
+
|
|
172
|
+
var Text = function (_super) {
|
|
173
|
+
__extends(Text, _super);
|
|
174
|
+
|
|
175
|
+
function Text(text, style) {
|
|
176
|
+
return _super.call(this, text, style) || this;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return Text;
|
|
180
|
+
}(pixi_js.Text);
|
|
181
|
+
|
|
182
|
+
var Text$1 = Text;
|
|
183
|
+
var PIXITilingSprite = pixi_js.extras.TilingSprite;
|
|
184
|
+
|
|
185
|
+
var TilingSprite = function () {
|
|
186
|
+
function TilingSprite(image) {
|
|
187
|
+
this._image = null;
|
|
188
|
+
this._image = image;
|
|
189
|
+
|
|
190
|
+
if (image) {
|
|
191
|
+
if (image instanceof HTMLImageElement) {
|
|
192
|
+
this.tilingSprite = new PIXITilingSprite(pixi_js.Texture.from(image));
|
|
193
|
+
} else if (image instanceof pixi_js.Texture) {
|
|
194
|
+
this.tilingSprite = new PIXITilingSprite(image);
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
this.tilingSprite = new PIXITilingSprite(pixi_js.Texture.EMPTY);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
Object.defineProperty(TilingSprite.prototype, "image", {
|
|
202
|
+
get: function get() {
|
|
203
|
+
return this._image;
|
|
204
|
+
},
|
|
205
|
+
set: function set(val) {
|
|
206
|
+
if (this._image === val) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (val instanceof HTMLImageElement) {
|
|
211
|
+
this.tilingSprite.texture = pixi_js.Texture.from(val);
|
|
212
|
+
} else if (val instanceof pixi_js.Texture) {
|
|
213
|
+
this.tilingSprite.texture = val;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
this._image = val;
|
|
217
|
+
},
|
|
218
|
+
enumerable: false,
|
|
219
|
+
configurable: true
|
|
220
|
+
});
|
|
221
|
+
return TilingSprite;
|
|
222
|
+
}();
|
|
223
|
+
|
|
224
|
+
var TilingSprite$1 = TilingSprite;
|
|
225
|
+
exports.Application = Application$1;
|
|
226
|
+
exports.Container = Container$1;
|
|
227
|
+
exports.Graphics = Graphics$1;
|
|
228
|
+
exports.NinePatch = NinePatch$1;
|
|
229
|
+
exports.Sprite = Sprite$1;
|
|
230
|
+
exports.SpriteAnimation = SpriteAnimation$1;
|
|
231
|
+
exports.Text = Text$1;
|
|
232
|
+
exports.TilingSprite = TilingSprite$1;
|
|
233
|
+
Object.defineProperty(exports, '__esModule', {
|
|
234
|
+
value: true
|
|
235
|
+
});
|
|
236
|
+
return exports;
|
|
237
|
+
}({}, PIXI);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
this.EVA=this.EVA||{},this.EVA.rendererAdapter=function(t,e){"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 i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function n(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(t){function e(e){return e.autoStart=!1,t.call(this,e)||this}return n(e,t),e}(e.Application),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(e.Container),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(e.Graphics),u=function(t){function i(i,n,r,o,a){var u;return u="string"===i?e.Texture.fromFrame(i):e.Texture.from(i),t.call(this,u,n,r,o,a)||this}return n(i,t),i}(e.mesh.NineSlicePlane),s=function(){function t(t){this._image=null,this._image=t,t?t instanceof HTMLImageElement?this.sprite=e.Sprite.from(t):t instanceof e.Texture&&(this.sprite=new e.Sprite(t)):this.sprite=new e.Sprite}return 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=e.Texture.from(t)):t instanceof e.Texture&&(this.sprite.texture=t),this._image=t)},enumerable:!1,configurable:!0}),t}(),p=function(){function t(t){var i=t.frames;this.animatedSprite=new e.extras.AnimatedSprite(i)}return 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}),t}(),c=function(t){function e(e,i){return t.call(this,e,i)||this}return n(e,t),e}(e.Text),f=e.extras.TilingSprite,h=function(){function t(t){this._image=null,this._image=t,t?t instanceof HTMLImageElement?this.tilingSprite=new f(e.Texture.from(t)):t instanceof e.Texture&&(this.tilingSprite=new f(t)):this.tilingSprite=new f(e.Texture.EMPTY)}return Object.defineProperty(t.prototype,"image",{get:function(){return this._image},set:function(t){this._image!==t&&(t instanceof HTMLImageElement?this.tilingSprite.texture=e.Texture.from(t):t instanceof e.Texture&&(this.tilingSprite.texture=t),this._image=t)},enumerable:!1,configurable:!0}),t}();return t.Application=r,t.Container=o,t.Graphics=a,t.NinePatch=u,t.Sprite=s,t.SpriteAnimation=p,t.Text=c,t.TilingSprite=h,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI);
|