@eva/plugin-renderer-img 2.1.0-beta.3 → 2.1.0-beta.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.
- package/dist/EVA.plugin.renderer.img.js +337 -0
- package/dist/EVA.plugin.renderer.img.min.js +1 -0
- package/dist/plugin-renderer-img.cjs.js +269 -0
- package/dist/plugin-renderer-img.cjs.prod.js +1 -0
- package/dist/plugin-renderer-img.d.ts +90 -0
- package/dist/plugin-renderer-img.esm.js +264 -0
- package/package.json +4 -4
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
globalThis.EVA = globalThis.EVA || {};
|
|
3
|
+
globalThis.EVA.plugin = globalThis.EVA.plugin || {};
|
|
4
|
+
globalThis.EVA.plugin.renderer = globalThis.EVA.plugin.renderer || {};
|
|
5
|
+
var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter, pixi_js) {
|
|
6
|
+
'use strict';
|
|
7
|
+
function __decorate(decorators, target, key, desc) {
|
|
8
|
+
var c = arguments.length,
|
|
9
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
10
|
+
d;
|
|
11
|
+
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--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
+
}
|
|
14
|
+
function __metadata(metadataKey, metadataValue) {
|
|
15
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
16
|
+
}
|
|
17
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) {
|
|
19
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
20
|
+
resolve(value);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) {
|
|
25
|
+
try {
|
|
26
|
+
step(generator.next(value));
|
|
27
|
+
} catch (e) {
|
|
28
|
+
reject(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function rejected(value) {
|
|
32
|
+
try {
|
|
33
|
+
step(generator["throw"](value));
|
|
34
|
+
} catch (e) {
|
|
35
|
+
reject(e);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function step(result) {
|
|
39
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
40
|
+
}
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
45
|
+
var e = new Error(message);
|
|
46
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
47
|
+
};
|
|
48
|
+
function __rest(s, e) {
|
|
49
|
+
var t = {};
|
|
50
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
51
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
}
|
|
56
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
57
|
+
var e = new Error(message);
|
|
58
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
59
|
+
};
|
|
60
|
+
class SymbolKeysNotSupportedError extends Error {
|
|
61
|
+
constructor() {
|
|
62
|
+
super('Symbol keys are not supported yet!');
|
|
63
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const IDE_PROPERTY_METADATA = 'IDE_PROPERTY_METADATA';
|
|
67
|
+
function transformBasicType(type) {
|
|
68
|
+
if (type === String) {
|
|
69
|
+
return 'string';
|
|
70
|
+
}
|
|
71
|
+
if (type === Number) {
|
|
72
|
+
return 'number';
|
|
73
|
+
}
|
|
74
|
+
if (type === Boolean) {
|
|
75
|
+
return 'boolean';
|
|
76
|
+
}
|
|
77
|
+
return 'unknown';
|
|
78
|
+
}
|
|
79
|
+
function defineLegacyIDEProp(target, propertyKey, patch) {
|
|
80
|
+
const constructor = target.constructor;
|
|
81
|
+
const current = constructor.IDEProps || {};
|
|
82
|
+
current[propertyKey] = _extends(_extends({
|
|
83
|
+
key: propertyKey
|
|
84
|
+
}, current[propertyKey]), patch);
|
|
85
|
+
constructor.IDEProps = current;
|
|
86
|
+
}
|
|
87
|
+
function defineTypes(target, key, options, returnTypeFunction) {
|
|
88
|
+
let type = Reflect.getMetadata('design:type', target, key);
|
|
89
|
+
let isArray = type === Array;
|
|
90
|
+
const str = transformBasicType(type);
|
|
91
|
+
if (str !== 'unknown') {
|
|
92
|
+
type = str;
|
|
93
|
+
}
|
|
94
|
+
if (returnTypeFunction) {
|
|
95
|
+
const returnType = returnTypeFunction();
|
|
96
|
+
if (Array.isArray(returnType)) {
|
|
97
|
+
isArray = true;
|
|
98
|
+
type = returnType[0];
|
|
99
|
+
} else {
|
|
100
|
+
type = returnType;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const properties = Reflect.getMetadata(IDE_PROPERTY_METADATA, target.constructor) || {};
|
|
104
|
+
const current = properties[key] || {};
|
|
105
|
+
const property = _extends(_extends(_extends({}, current), {
|
|
106
|
+
type,
|
|
107
|
+
isArray: isArray
|
|
108
|
+
}), options);
|
|
109
|
+
properties[key] = property;
|
|
110
|
+
Reflect.defineMetadata(IDE_PROPERTY_METADATA, properties, target.constructor);
|
|
111
|
+
const legacyProperty = __rest(property, ["isArray"]);
|
|
112
|
+
defineLegacyIDEProp(target, key, legacyProperty);
|
|
113
|
+
}
|
|
114
|
+
function type(type) {
|
|
115
|
+
return Field({
|
|
116
|
+
type
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
|
|
120
|
+
if (typeof returnTypeFuncOrOptions === 'function') {
|
|
121
|
+
return {
|
|
122
|
+
returnTypeFunc: returnTypeFuncOrOptions,
|
|
123
|
+
options: maybeOptions || {}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
options: returnTypeFuncOrOptions || {}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function Field(returnTypeFunction, maybeOptions) {
|
|
131
|
+
return (target, propertyKey) => {
|
|
132
|
+
if (typeof propertyKey === 'symbol') {
|
|
133
|
+
throw new SymbolKeysNotSupportedError();
|
|
134
|
+
}
|
|
135
|
+
const {
|
|
136
|
+
options,
|
|
137
|
+
returnTypeFunc
|
|
138
|
+
} = getTypeDecoratorParams(returnTypeFunction, maybeOptions);
|
|
139
|
+
defineTypes(target, propertyKey, options, returnTypeFunc);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
var ExecuteMode;
|
|
143
|
+
(function (ExecuteMode) {
|
|
144
|
+
ExecuteMode[ExecuteMode["Edit"] = 2] = "Edit";
|
|
145
|
+
ExecuteMode[ExecuteMode["Game"] = 4] = "Game";
|
|
146
|
+
ExecuteMode[ExecuteMode["All"] = 6] = "All";
|
|
147
|
+
})(ExecuteMode || (ExecuteMode = {}));
|
|
148
|
+
class Img$2 extends eva_js.Component {
|
|
149
|
+
constructor(params) {
|
|
150
|
+
super(params);
|
|
151
|
+
this.resource = '';
|
|
152
|
+
this.anchor = {
|
|
153
|
+
x: 0,
|
|
154
|
+
y: 0
|
|
155
|
+
};
|
|
156
|
+
this.init(params);
|
|
157
|
+
}
|
|
158
|
+
init(obj) {
|
|
159
|
+
var _a, _b;
|
|
160
|
+
if (obj && obj.resource) {
|
|
161
|
+
this.resource = obj.resource;
|
|
162
|
+
}
|
|
163
|
+
if (obj && obj.anchor) {
|
|
164
|
+
this.anchor = {
|
|
165
|
+
x: (_a = obj.anchor.x) !== null && _a !== void 0 ? _a : this.anchor.x,
|
|
166
|
+
y: (_b = obj.anchor.y) !== null && _b !== void 0 ? _b : this.anchor.y
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
if (obj && typeof obj.width === 'number') {
|
|
170
|
+
this.width = obj.width;
|
|
171
|
+
}
|
|
172
|
+
if (obj && typeof obj.height === 'number') {
|
|
173
|
+
this.height = obj.height;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
load(resource) {
|
|
177
|
+
if (resource) {
|
|
178
|
+
this.resource = resource;
|
|
179
|
+
}
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
setAnchor(x, y = x) {
|
|
183
|
+
this.anchor.x = x;
|
|
184
|
+
this.anchor.y = y;
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
setSize(width, height) {
|
|
188
|
+
this.width = width;
|
|
189
|
+
this.height = height;
|
|
190
|
+
return this;
|
|
191
|
+
}
|
|
192
|
+
destroy() {
|
|
193
|
+
return this;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
Img$2.componentName = 'Img';
|
|
197
|
+
__decorate([type('string'), __metadata("design:type", String)], Img$2.prototype, "resource", void 0);
|
|
198
|
+
__decorate([type('number'), __metadata("design:type", Number)], Img$2.prototype, "width", void 0);
|
|
199
|
+
__decorate([type('number'), __metadata("design:type", Number)], Img$2.prototype, "height", void 0);
|
|
200
|
+
eva_js.resource.registerInstance(eva_js.RESOURCE_TYPE.IMAGE, ({
|
|
201
|
+
data = {}
|
|
202
|
+
}) => {
|
|
203
|
+
const {
|
|
204
|
+
image
|
|
205
|
+
} = data;
|
|
206
|
+
if (image) {
|
|
207
|
+
if (image instanceof pixi_js.Texture) {
|
|
208
|
+
return image;
|
|
209
|
+
}
|
|
210
|
+
const texture = pixi_js.Texture.from(image);
|
|
211
|
+
return texture;
|
|
212
|
+
}
|
|
213
|
+
return data;
|
|
214
|
+
});
|
|
215
|
+
eva_js.resource.registerDestroy(eva_js.RESOURCE_TYPE.IMAGE, ({
|
|
216
|
+
instance
|
|
217
|
+
}) => {
|
|
218
|
+
if (instance) {
|
|
219
|
+
instance.destroy(true);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
let Img = class Img extends pluginRenderer.Renderer {
|
|
223
|
+
constructor() {
|
|
224
|
+
super(...arguments);
|
|
225
|
+
this.name = 'ImgSystem';
|
|
226
|
+
this.imgs = {};
|
|
227
|
+
}
|
|
228
|
+
init(_params) {
|
|
229
|
+
var _a, _b;
|
|
230
|
+
const renderSystem = (_b = (_a = this.game) === null || _a === void 0 ? void 0 : _a.getSystem) === null || _b === void 0 ? void 0 : _b.call(_a, pluginRenderer.RendererSystem);
|
|
231
|
+
if (!(renderSystem === null || renderSystem === void 0 ? void 0 : renderSystem.rendererManager)) return;
|
|
232
|
+
this.renderSystem = renderSystem;
|
|
233
|
+
this.renderSystem.rendererManager.register(this);
|
|
234
|
+
}
|
|
235
|
+
update(_frame) {
|
|
236
|
+
super.update(_frame);
|
|
237
|
+
}
|
|
238
|
+
rendererUpdate(gameObject) {
|
|
239
|
+
const component = gameObject.getComponent('Img');
|
|
240
|
+
this.applySpriteLayout(gameObject, component);
|
|
241
|
+
}
|
|
242
|
+
componentChanged(changed) {
|
|
243
|
+
var _a, _b, _c, _d, _e, _f;
|
|
244
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
245
|
+
if (changed.componentName === 'Img') {
|
|
246
|
+
const gameObjectId = changed.gameObject.id;
|
|
247
|
+
const component = changed.component;
|
|
248
|
+
if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
|
|
249
|
+
const sprite = new rendererAdapter.Sprite(null);
|
|
250
|
+
this.imgs[gameObjectId] = sprite;
|
|
251
|
+
(_b = (_a = this.containerManager) === null || _a === void 0 ? void 0 : _a.getContainer(gameObjectId)) === null || _b === void 0 ? void 0 : _b.addChildAt(sprite.sprite, 0);
|
|
252
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
253
|
+
const asyncId = this.increaseAsyncId(gameObjectId);
|
|
254
|
+
const {
|
|
255
|
+
instance
|
|
256
|
+
} = yield eva_js.resource.getResource(component.resource);
|
|
257
|
+
if (!this.validateAsyncId(gameObjectId, asyncId)) return;
|
|
258
|
+
if (!instance) {
|
|
259
|
+
console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
sprite.image = instance;
|
|
263
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
264
|
+
} else if (changed.type === eva_js.OBSERVER_TYPE.CHANGE) {
|
|
265
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
266
|
+
if ((_d = (_c = changed.prop) === null || _c === void 0 ? void 0 : _c.prop) === null || _d === void 0 ? void 0 : _d.includes('resource')) {
|
|
267
|
+
const asyncId = this.increaseAsyncId(gameObjectId);
|
|
268
|
+
const {
|
|
269
|
+
instance
|
|
270
|
+
} = yield eva_js.resource.getResource(component.resource);
|
|
271
|
+
if (!this.validateAsyncId(gameObjectId, asyncId)) return;
|
|
272
|
+
if (!instance) {
|
|
273
|
+
console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
this.imgs[gameObjectId].image = instance;
|
|
277
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
278
|
+
}
|
|
279
|
+
} else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
280
|
+
this.increaseAsyncId(gameObjectId);
|
|
281
|
+
const sprite = this.imgs[gameObjectId];
|
|
282
|
+
if (!sprite) return;
|
|
283
|
+
(_f = (_e = this.containerManager) === null || _e === void 0 ? void 0 : _e.getContainer(gameObjectId)) === null || _f === void 0 ? void 0 : _f.removeChild(sprite.sprite);
|
|
284
|
+
sprite.sprite.destroy({
|
|
285
|
+
children: true
|
|
286
|
+
});
|
|
287
|
+
delete this.imgs[gameObjectId];
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
applySpriteLayout(gameObject, component) {
|
|
293
|
+
var _a, _b, _c, _d, _e;
|
|
294
|
+
const sprite = this.imgs[gameObject.id];
|
|
295
|
+
if (!sprite) return;
|
|
296
|
+
const size = (_a = gameObject.transform) === null || _a === void 0 ? void 0 : _a.size;
|
|
297
|
+
const width = (_b = component === null || component === void 0 ? void 0 : component.width) !== null && _b !== void 0 ? _b : size === null || size === void 0 ? void 0 : size.width;
|
|
298
|
+
const height = (_c = component === null || component === void 0 ? void 0 : component.height) !== null && _c !== void 0 ? _c : size === null || size === void 0 ? void 0 : size.height;
|
|
299
|
+
if (typeof width === 'number') {
|
|
300
|
+
sprite.sprite.width = width;
|
|
301
|
+
}
|
|
302
|
+
if (typeof height === 'number') {
|
|
303
|
+
sprite.sprite.height = height;
|
|
304
|
+
}
|
|
305
|
+
const anchor = component === null || component === void 0 ? void 0 : component.anchor;
|
|
306
|
+
if (anchor) {
|
|
307
|
+
(_e = (_d = sprite.sprite.anchor) === null || _d === void 0 ? void 0 : _d.set) === null || _e === void 0 ? void 0 : _e.call(_d, anchor.x, anchor.y);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
destroy() {
|
|
311
|
+
var _a, _b;
|
|
312
|
+
for (const key in this.imgs) {
|
|
313
|
+
const sprite = this.imgs[key];
|
|
314
|
+
(_b = (_a = this.containerManager) === null || _a === void 0 ? void 0 : _a.getContainer(parseInt(key))) === null || _b === void 0 ? void 0 : _b.removeChild(sprite.sprite);
|
|
315
|
+
sprite.sprite.destroy({
|
|
316
|
+
children: true
|
|
317
|
+
});
|
|
318
|
+
delete this.imgs[key];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
Img.systemName = 'ImgSystem';
|
|
323
|
+
Img = __decorate([eva_js.decorators.componentObserver({
|
|
324
|
+
Img: ['resource', {
|
|
325
|
+
prop: 'anchor',
|
|
326
|
+
deep: true
|
|
327
|
+
}, 'width', 'height']
|
|
328
|
+
})], Img);
|
|
329
|
+
var Img$1 = Img;
|
|
330
|
+
exports.Img = Img$2;
|
|
331
|
+
exports.ImgSystem = Img$1;
|
|
332
|
+
Object.defineProperty(exports, '__esModule', {
|
|
333
|
+
value: true
|
|
334
|
+
});
|
|
335
|
+
return exports;
|
|
336
|
+
}({}, EVA, EVA.plugin.renderer, EVA.rendererAdapter, PIXI);
|
|
337
|
+
globalThis.EVA.plugin.renderer.img = globalThis.EVA.plugin.renderer.img || _EVA_IIFE_img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(null,arguments)}globalThis.EVA=globalThis.EVA||{},globalThis.EVA.plugin=globalThis.EVA.plugin||{},globalThis.EVA.plugin.renderer=globalThis.EVA.plugin.renderer||{};var _EVA_IIFE_img=function(e,t,r,n,o){"use strict";function i(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,c)}a((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError,"function"==typeof SuppressedError&&SuppressedError;class a extends Error{constructor(){super("Symbol keys are not supported yet!"),Object.setPrototypeOf(this,new.target.prototype)}}const u="IDE_PROPERTY_METADATA";function l(e,t,r,n){let o=Reflect.getMetadata("design:type",e,t),i=o===Array;const s=function(e){return e===String?"string":e===Number?"number":e===Boolean?"boolean":"unknown"}(o);if("unknown"!==s&&(o=s),n){const e=n();Array.isArray(e)?(i=!0,o=e[0]):o=e}const c=Reflect.getMetadata(u,e.constructor)||{},a=_extends(_extends(_extends({},c[t]||{}),{type:o,isArray:i}),r);c[t]=a,Reflect.defineMetadata(u,c,e.constructor);!function(e,t,r){const n=e.constructor,o=n.IDEProps||{};o[t]=_extends(_extends({key:t},o[t]),r),n.IDEProps=o}(e,t,function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(a,["isArray"]))}function d(e){return t={type:e},(e,n)=>{if("symbol"==typeof n)throw new a;const{options:o,returnTypeFunc:i}=function(e,t){return"function"==typeof e?{returnTypeFunc:e,options:t||{}}:{options:e||{}}}(t,r);l(e,n,o,i)};var t,r}var p;!function(e){e[e.Edit=2]="Edit",e[e.Game=4]="Game",e[e.All=6]="All"}(p||(p={}));class h extends t.Component{constructor(e){super(e),this.resource="",this.anchor={x:0,y:0},this.init(e)}init(e){var t,r;e&&e.resource&&(this.resource=e.resource),e&&e.anchor&&(this.anchor={x:null!==(t=e.anchor.x)&&void 0!==t?t:this.anchor.x,y:null!==(r=e.anchor.y)&&void 0!==r?r:this.anchor.y}),e&&"number"==typeof e.width&&(this.width=e.width),e&&"number"==typeof e.height&&(this.height=e.height)}load(e){return e&&(this.resource=e),this}setAnchor(e,t=e){return this.anchor.x=e,this.anchor.y=t,this}setSize(e,t){return this.width=e,this.height=t,this}destroy(){return this}}h.componentName="Img",i([d("string"),s("design:type",String)],h.prototype,"resource",void 0),i([d("number"),s("design:type",Number)],h.prototype,"width",void 0),i([d("number"),s("design:type",Number)],h.prototype,"height",void 0),t.resource.registerInstance(t.RESOURCE_TYPE.IMAGE,({data:e={}})=>{const{image:t}=e;if(t){if(t instanceof o.Texture)return t;return o.Texture.from(t)}return e}),t.resource.registerDestroy(t.RESOURCE_TYPE.IMAGE,({instance:e})=>{e&&e.destroy(!0)});let g=class extends r.Renderer{constructor(){super(...arguments),this.name="ImgSystem",this.imgs={}}init(e){var t,n;const o=null===(n=null===(t=this.game)||void 0===t?void 0:t.getSystem)||void 0===n?void 0:n.call(t,r.RendererSystem);(null==o?void 0:o.rendererManager)&&(this.renderSystem=o,this.renderSystem.rendererManager.register(this))}update(e){super.update(e)}rendererUpdate(e){const t=e.getComponent("Img");this.applySpriteLayout(e,t)}componentChanged(e){var r,o,i,s,a,u;return c(this,void 0,void 0,function*(){if("Img"===e.componentName){const c=e.gameObject.id,l=e.component;if(e.type===t.OBSERVER_TYPE.ADD){const i=new n.Sprite(null);this.imgs[c]=i,null===(o=null===(r=this.containerManager)||void 0===r?void 0:r.getContainer(c))||void 0===o||o.addChildAt(i.sprite,0),this.applySpriteLayout(e.gameObject,l);const s=this.increaseAsyncId(c),{instance:a}=yield t.resource.getResource(l.resource);if(!this.validateAsyncId(c,s))return;if(!a)return void console.error(`GameObject:${e.gameObject.name}'s Img resource load error`);i.image=a,this.applySpriteLayout(e.gameObject,l)}else if(e.type===t.OBSERVER_TYPE.CHANGE){if(this.applySpriteLayout(e.gameObject,l),null===(s=null===(i=e.prop)||void 0===i?void 0:i.prop)||void 0===s?void 0:s.includes("resource")){const r=this.increaseAsyncId(c),{instance:n}=yield t.resource.getResource(l.resource);if(!this.validateAsyncId(c,r))return;if(!n)return void console.error(`GameObject:${e.gameObject.name}'s Img resource load error`);this.imgs[c].image=n,this.applySpriteLayout(e.gameObject,l)}}else if(e.type===t.OBSERVER_TYPE.REMOVE){this.increaseAsyncId(c);const e=this.imgs[c];if(!e)return;null===(u=null===(a=this.containerManager)||void 0===a?void 0:a.getContainer(c))||void 0===u||u.removeChild(e.sprite),e.sprite.destroy({children:!0}),delete this.imgs[c]}}})}applySpriteLayout(e,t){var r,n,o,i,s;const c=this.imgs[e.id];if(!c)return;const a=null===(r=e.transform)||void 0===r?void 0:r.size,u=null!==(n=null==t?void 0:t.width)&&void 0!==n?n:null==a?void 0:a.width,l=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:null==a?void 0:a.height;"number"==typeof u&&(c.sprite.width=u),"number"==typeof l&&(c.sprite.height=l);const d=null==t?void 0:t.anchor;d&&(null===(s=null===(i=c.sprite.anchor)||void 0===i?void 0:i.set)||void 0===s||s.call(i,d.x,d.y))}destroy(){var e,t;for(const r in this.imgs){const n=this.imgs[r];null===(t=null===(e=this.containerManager)||void 0===e?void 0:e.getContainer(parseInt(r)))||void 0===t||t.removeChild(n.sprite),n.sprite.destroy({children:!0}),delete this.imgs[r]}}};g.systemName="ImgSystem",g=i([t.decorators.componentObserver({Img:["resource",{prop:"anchor",deep:!0},"width","height"]})],g);var y=g;return e.Img=h,e.ImgSystem=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,EVA.rendererAdapter,PIXI);globalThis.EVA.plugin.renderer.img=globalThis.EVA.plugin.renderer.img||_EVA_IIFE_img;
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var inspectorDecorator = require('@eva/inspector-decorator');
|
|
6
|
+
var eva_js = require('@eva/eva.js');
|
|
7
|
+
var pluginRenderer = require('@eva/plugin-renderer');
|
|
8
|
+
var rendererAdapter = require('@eva/renderer-adapter');
|
|
9
|
+
var pixi_js = require('pixi.js');
|
|
10
|
+
|
|
11
|
+
/******************************************************************************
|
|
12
|
+
Copyright (c) Microsoft Corporation.
|
|
13
|
+
|
|
14
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
15
|
+
purpose with or without fee is hereby granted.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
18
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
19
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
20
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
21
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
+
***************************************************************************** */
|
|
25
|
+
|
|
26
|
+
function __decorate(decorators, target, key, desc) {
|
|
27
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
28
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
29
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
30
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function __metadata(metadataKey, metadataValue) {
|
|
34
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
38
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
39
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
40
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
41
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
42
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
43
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
48
|
+
var e = new Error(message);
|
|
49
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 图片组件
|
|
54
|
+
*
|
|
55
|
+
* Img 组件用于渲染单张图片。
|
|
56
|
+
* 它是最基础的图像渲染组件,适用于背景、UI 元素、静态贴图等场景。
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* // 渲染一张背景图
|
|
61
|
+
* const background = new GameObject('background');
|
|
62
|
+
* background.addComponent(new Img({
|
|
63
|
+
* resource: 'bgImage' // 资源名称
|
|
64
|
+
* }));
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
class Img$2 extends eva_js.Component {
|
|
68
|
+
constructor(params) {
|
|
69
|
+
super(params);
|
|
70
|
+
/** 图片资源名称 */
|
|
71
|
+
this.resource = '';
|
|
72
|
+
/** 图片锚点 */
|
|
73
|
+
this.anchor = { x: 0, y: 0 };
|
|
74
|
+
this.init(params);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 初始化组件
|
|
78
|
+
* @param obj - 初始化参数
|
|
79
|
+
*
|
|
80
|
+
* 配置项包括 resource、anchor、width 和 height。
|
|
81
|
+
*/
|
|
82
|
+
init(obj) {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
if (obj && obj.resource) {
|
|
85
|
+
this.resource = obj.resource;
|
|
86
|
+
}
|
|
87
|
+
if (obj && obj.anchor) {
|
|
88
|
+
this.anchor = {
|
|
89
|
+
x: (_a = obj.anchor.x) !== null && _a !== void 0 ? _a : this.anchor.x,
|
|
90
|
+
y: (_b = obj.anchor.y) !== null && _b !== void 0 ? _b : this.anchor.y,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (obj && typeof obj.width === 'number') {
|
|
94
|
+
this.width = obj.width;
|
|
95
|
+
}
|
|
96
|
+
if (obj && typeof obj.height === 'number') {
|
|
97
|
+
this.height = obj.height;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* 切换当前图片资源。
|
|
102
|
+
*
|
|
103
|
+
* ImgSystem 会监听 resource 变化并刷新渲染纹理。
|
|
104
|
+
*
|
|
105
|
+
* @param resource - 图片资源名称
|
|
106
|
+
*/
|
|
107
|
+
load(resource) {
|
|
108
|
+
if (resource) {
|
|
109
|
+
this.resource = resource;
|
|
110
|
+
}
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
/** 设置图片锚点。 */
|
|
114
|
+
setAnchor(x, y = x) {
|
|
115
|
+
this.anchor.x = x;
|
|
116
|
+
this.anchor.y = y;
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
/** 设置显式渲染尺寸。 */
|
|
120
|
+
setSize(width, height) {
|
|
121
|
+
this.width = width;
|
|
122
|
+
this.height = height;
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
/** 释放组件持有的可编辑状态。渲染资源由 ImgSystem 统一管理。 */
|
|
126
|
+
destroy() {
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** 组件名称 */
|
|
131
|
+
Img$2.componentName = 'Img';
|
|
132
|
+
__decorate([
|
|
133
|
+
inspectorDecorator.type('string'),
|
|
134
|
+
__metadata("design:type", String)
|
|
135
|
+
], Img$2.prototype, "resource", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
inspectorDecorator.type('number'),
|
|
138
|
+
__metadata("design:type", Number)
|
|
139
|
+
], Img$2.prototype, "width", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
inspectorDecorator.type('number'),
|
|
142
|
+
__metadata("design:type", Number)
|
|
143
|
+
], Img$2.prototype, "height", void 0);
|
|
144
|
+
|
|
145
|
+
eva_js.resource.registerInstance(eva_js.RESOURCE_TYPE.IMAGE, ({ data = {} }) => {
|
|
146
|
+
const { image } = data;
|
|
147
|
+
if (image) {
|
|
148
|
+
if (image instanceof pixi_js.Texture) {
|
|
149
|
+
return image;
|
|
150
|
+
}
|
|
151
|
+
const texture = pixi_js.Texture.from(image);
|
|
152
|
+
return texture;
|
|
153
|
+
}
|
|
154
|
+
return data;
|
|
155
|
+
});
|
|
156
|
+
eva_js.resource.registerDestroy(eva_js.RESOURCE_TYPE.IMAGE, ({ instance }) => {
|
|
157
|
+
if (instance) {
|
|
158
|
+
instance.destroy(true);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
let Img = class Img extends pluginRenderer.Renderer {
|
|
162
|
+
constructor() {
|
|
163
|
+
super(...arguments);
|
|
164
|
+
this.name = 'ImgSystem';
|
|
165
|
+
this.imgs = {};
|
|
166
|
+
}
|
|
167
|
+
init(_params) {
|
|
168
|
+
var _a, _b;
|
|
169
|
+
const renderSystem = (_b = (_a = this.game) === null || _a === void 0 ? void 0 : _a.getSystem) === null || _b === void 0 ? void 0 : _b.call(_a, pluginRenderer.RendererSystem);
|
|
170
|
+
if (!(renderSystem === null || renderSystem === void 0 ? void 0 : renderSystem.rendererManager))
|
|
171
|
+
return;
|
|
172
|
+
this.renderSystem = renderSystem;
|
|
173
|
+
this.renderSystem.rendererManager.register(this);
|
|
174
|
+
}
|
|
175
|
+
update(_frame) {
|
|
176
|
+
super.update(_frame);
|
|
177
|
+
}
|
|
178
|
+
rendererUpdate(gameObject) {
|
|
179
|
+
const component = gameObject.getComponent('Img');
|
|
180
|
+
this.applySpriteLayout(gameObject, component);
|
|
181
|
+
}
|
|
182
|
+
componentChanged(changed) {
|
|
183
|
+
var _a, _b, _c, _d, _e, _f;
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
if (changed.componentName === 'Img') {
|
|
186
|
+
const gameObjectId = changed.gameObject.id;
|
|
187
|
+
const component = changed.component;
|
|
188
|
+
if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
|
|
189
|
+
const sprite = new rendererAdapter.Sprite(null);
|
|
190
|
+
this.imgs[gameObjectId] = sprite;
|
|
191
|
+
(_b = (_a = this.containerManager) === null || _a === void 0 ? void 0 : _a.getContainer(gameObjectId)) === null || _b === void 0 ? void 0 : _b.addChildAt(sprite.sprite, 0);
|
|
192
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
193
|
+
const asyncId = this.increaseAsyncId(gameObjectId);
|
|
194
|
+
const { instance } = yield eva_js.resource.getResource(component.resource);
|
|
195
|
+
if (!this.validateAsyncId(gameObjectId, asyncId))
|
|
196
|
+
return;
|
|
197
|
+
if (!instance) {
|
|
198
|
+
console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
sprite.image = instance;
|
|
202
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
203
|
+
}
|
|
204
|
+
else if (changed.type === eva_js.OBSERVER_TYPE.CHANGE) {
|
|
205
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
206
|
+
if ((_d = (_c = changed.prop) === null || _c === void 0 ? void 0 : _c.prop) === null || _d === void 0 ? void 0 : _d.includes('resource')) {
|
|
207
|
+
const asyncId = this.increaseAsyncId(gameObjectId);
|
|
208
|
+
const { instance } = yield eva_js.resource.getResource(component.resource);
|
|
209
|
+
if (!this.validateAsyncId(gameObjectId, asyncId))
|
|
210
|
+
return;
|
|
211
|
+
if (!instance) {
|
|
212
|
+
console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
this.imgs[gameObjectId].image = instance;
|
|
216
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
220
|
+
this.increaseAsyncId(gameObjectId);
|
|
221
|
+
const sprite = this.imgs[gameObjectId];
|
|
222
|
+
if (!sprite)
|
|
223
|
+
return;
|
|
224
|
+
(_f = (_e = this.containerManager) === null || _e === void 0 ? void 0 : _e.getContainer(gameObjectId)) === null || _f === void 0 ? void 0 : _f.removeChild(sprite.sprite);
|
|
225
|
+
sprite.sprite.destroy({ children: true });
|
|
226
|
+
delete this.imgs[gameObjectId];
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
applySpriteLayout(gameObject, component) {
|
|
232
|
+
var _a, _b, _c, _d, _e;
|
|
233
|
+
const sprite = this.imgs[gameObject.id];
|
|
234
|
+
if (!sprite)
|
|
235
|
+
return;
|
|
236
|
+
const size = (_a = gameObject.transform) === null || _a === void 0 ? void 0 : _a.size;
|
|
237
|
+
const width = (_b = component === null || component === void 0 ? void 0 : component.width) !== null && _b !== void 0 ? _b : size === null || size === void 0 ? void 0 : size.width;
|
|
238
|
+
const height = (_c = component === null || component === void 0 ? void 0 : component.height) !== null && _c !== void 0 ? _c : size === null || size === void 0 ? void 0 : size.height;
|
|
239
|
+
if (typeof width === 'number') {
|
|
240
|
+
sprite.sprite.width = width;
|
|
241
|
+
}
|
|
242
|
+
if (typeof height === 'number') {
|
|
243
|
+
sprite.sprite.height = height;
|
|
244
|
+
}
|
|
245
|
+
const anchor = component === null || component === void 0 ? void 0 : component.anchor;
|
|
246
|
+
if (anchor) {
|
|
247
|
+
(_e = (_d = sprite.sprite.anchor) === null || _d === void 0 ? void 0 : _d.set) === null || _e === void 0 ? void 0 : _e.call(_d, anchor.x, anchor.y);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
destroy() {
|
|
251
|
+
var _a, _b;
|
|
252
|
+
for (const key in this.imgs) {
|
|
253
|
+
const sprite = this.imgs[key];
|
|
254
|
+
(_b = (_a = this.containerManager) === null || _a === void 0 ? void 0 : _a.getContainer(parseInt(key))) === null || _b === void 0 ? void 0 : _b.removeChild(sprite.sprite);
|
|
255
|
+
sprite.sprite.destroy({ children: true });
|
|
256
|
+
delete this.imgs[key];
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
Img.systemName = 'ImgSystem';
|
|
261
|
+
Img = __decorate([
|
|
262
|
+
eva_js.decorators.componentObserver({
|
|
263
|
+
Img: ['resource', { prop: 'anchor', deep: true }, 'width', 'height'],
|
|
264
|
+
})
|
|
265
|
+
], Img);
|
|
266
|
+
var Img$1 = Img;
|
|
267
|
+
|
|
268
|
+
exports.Img = Img$2;
|
|
269
|
+
exports.ImgSystem = Img$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/inspector-decorator"),t=require("@eva/eva.js"),r=require("@eva/plugin-renderer"),i=require("@eva/renderer-adapter"),n=require("pixi.js");function o(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,i){return new(r||(r=Promise))(function(n,o){function s(e){try{a(i.next(e))}catch(e){o(e)}}function c(e){try{a(i.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,c)}a((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class a extends t.Component{constructor(e){super(e),this.resource="",this.anchor={x:0,y:0},this.init(e)}init(e){var t,r;e&&e.resource&&(this.resource=e.resource),e&&e.anchor&&(this.anchor={x:null!==(t=e.anchor.x)&&void 0!==t?t:this.anchor.x,y:null!==(r=e.anchor.y)&&void 0!==r?r:this.anchor.y}),e&&"number"==typeof e.width&&(this.width=e.width),e&&"number"==typeof e.height&&(this.height=e.height)}load(e){return e&&(this.resource=e),this}setAnchor(e,t=e){return this.anchor.x=e,this.anchor.y=t,this}setSize(e,t){return this.width=e,this.height=t,this}destroy(){return this}}a.componentName="Img",o([e.type("string"),s("design:type",String)],a.prototype,"resource",void 0),o([e.type("number"),s("design:type",Number)],a.prototype,"width",void 0),o([e.type("number"),s("design:type",Number)],a.prototype,"height",void 0),t.resource.registerInstance(t.RESOURCE_TYPE.IMAGE,({data:e={}})=>{const{image:t}=e;if(t){if(t instanceof n.Texture)return t;return n.Texture.from(t)}return e}),t.resource.registerDestroy(t.RESOURCE_TYPE.IMAGE,({instance:e})=>{e&&e.destroy(!0)});let d=class extends r.Renderer{constructor(){super(...arguments),this.name="ImgSystem",this.imgs={}}init(e){var t,i;const n=null===(i=null===(t=this.game)||void 0===t?void 0:t.getSystem)||void 0===i?void 0:i.call(t,r.RendererSystem);(null==n?void 0:n.rendererManager)&&(this.renderSystem=n,this.renderSystem.rendererManager.register(this))}update(e){super.update(e)}rendererUpdate(e){const t=e.getComponent("Img");this.applySpriteLayout(e,t)}componentChanged(e){var r,n,o,s,a,d;return c(this,void 0,void 0,function*(){if("Img"===e.componentName){const c=e.gameObject.id,u=e.component;if(e.type===t.OBSERVER_TYPE.ADD){const o=new i.Sprite(null);this.imgs[c]=o,null===(n=null===(r=this.containerManager)||void 0===r?void 0:r.getContainer(c))||void 0===n||n.addChildAt(o.sprite,0),this.applySpriteLayout(e.gameObject,u);const s=this.increaseAsyncId(c),{instance:a}=yield t.resource.getResource(u.resource);if(!this.validateAsyncId(c,s))return;if(!a)return void console.error(`GameObject:${e.gameObject.name}'s Img resource load error`);o.image=a,this.applySpriteLayout(e.gameObject,u)}else if(e.type===t.OBSERVER_TYPE.CHANGE){if(this.applySpriteLayout(e.gameObject,u),null===(s=null===(o=e.prop)||void 0===o?void 0:o.prop)||void 0===s?void 0:s.includes("resource")){const r=this.increaseAsyncId(c),{instance:i}=yield t.resource.getResource(u.resource);if(!this.validateAsyncId(c,r))return;if(!i)return void console.error(`GameObject:${e.gameObject.name}'s Img resource load error`);this.imgs[c].image=i,this.applySpriteLayout(e.gameObject,u)}}else if(e.type===t.OBSERVER_TYPE.REMOVE){this.increaseAsyncId(c);const e=this.imgs[c];if(!e)return;null===(d=null===(a=this.containerManager)||void 0===a?void 0:a.getContainer(c))||void 0===d||d.removeChild(e.sprite),e.sprite.destroy({children:!0}),delete this.imgs[c]}}})}applySpriteLayout(e,t){var r,i,n,o,s;const c=this.imgs[e.id];if(!c)return;const a=null===(r=e.transform)||void 0===r?void 0:r.size,d=null!==(i=null==t?void 0:t.width)&&void 0!==i?i:null==a?void 0:a.width,u=null!==(n=null==t?void 0:t.height)&&void 0!==n?n:null==a?void 0:a.height;"number"==typeof d&&(c.sprite.width=d),"number"==typeof u&&(c.sprite.height=u);const h=null==t?void 0:t.anchor;h&&(null===(s=null===(o=c.sprite.anchor)||void 0===o?void 0:o.set)||void 0===s||s.call(o,h.x,h.y))}destroy(){var e,t;for(const r in this.imgs){const i=this.imgs[r];null===(t=null===(e=this.containerManager)||void 0===e?void 0:e.getContainer(parseInt(r)))||void 0===t||t.removeChild(i.sprite),i.sprite.destroy({children:!0}),delete this.imgs[r]}}};d.systemName="ImgSystem",d=o([t.decorators.componentObserver({Img:["resource",{prop:"anchor",deep:!0},"width","height"]})],d);var u=d;exports.Img=a,exports.ImgSystem=u;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Component } from '@eva/eva.js';
|
|
2
|
+
import { ComponentChanged } from '@eva/eva.js';
|
|
3
|
+
import { ContainerManager } from '@eva/plugin-renderer';
|
|
4
|
+
import { GameObject } from '@eva/eva.js';
|
|
5
|
+
import { Renderer } from '@eva/plugin-renderer';
|
|
6
|
+
import { RendererManager } from '@eva/plugin-renderer';
|
|
7
|
+
import { RendererSystem } from '@eva/plugin-renderer';
|
|
8
|
+
import { Sprite } from '@eva/renderer-adapter';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 图片组件
|
|
12
|
+
*
|
|
13
|
+
* Img 组件用于渲染单张图片。
|
|
14
|
+
* 它是最基础的图像渲染组件,适用于背景、UI 元素、静态贴图等场景。
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // 渲染一张背景图
|
|
19
|
+
* const background = new GameObject('background');
|
|
20
|
+
* background.addComponent(new Img({
|
|
21
|
+
* resource: 'bgImage' // 资源名称
|
|
22
|
+
* }));
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class Img extends Component<ImgParams> {
|
|
26
|
+
/** 组件名称 */
|
|
27
|
+
static componentName: string;
|
|
28
|
+
/** 图片资源名称 */
|
|
29
|
+
resource: string;
|
|
30
|
+
/** 图片锚点 */
|
|
31
|
+
anchor: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
/** 显式渲染宽度 */
|
|
36
|
+
width?: number;
|
|
37
|
+
/** 显式渲染高度 */
|
|
38
|
+
height?: number;
|
|
39
|
+
constructor(params?: ImgParams);
|
|
40
|
+
/**
|
|
41
|
+
* 初始化组件
|
|
42
|
+
* @param obj - 初始化参数
|
|
43
|
+
*
|
|
44
|
+
* 配置项包括 resource、anchor、width 和 height。
|
|
45
|
+
*/
|
|
46
|
+
init(obj?: ImgParams): void;
|
|
47
|
+
/**
|
|
48
|
+
* 切换当前图片资源。
|
|
49
|
+
*
|
|
50
|
+
* ImgSystem 会监听 resource 变化并刷新渲染纹理。
|
|
51
|
+
*
|
|
52
|
+
* @param resource - 图片资源名称
|
|
53
|
+
*/
|
|
54
|
+
load(resource?: string): this;
|
|
55
|
+
/** 设置图片锚点。 */
|
|
56
|
+
setAnchor(x: number, y?: number): this;
|
|
57
|
+
/** 设置显式渲染尺寸。 */
|
|
58
|
+
setSize(width?: number, height?: number): this;
|
|
59
|
+
/** 释放组件持有的可编辑状态。渲染资源由 ImgSystem 统一管理。 */
|
|
60
|
+
destroy(): this;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export declare interface ImgParams {
|
|
64
|
+
resource: string;
|
|
65
|
+
anchor?: {
|
|
66
|
+
x?: number;
|
|
67
|
+
y?: number;
|
|
68
|
+
};
|
|
69
|
+
width?: number;
|
|
70
|
+
height?: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export declare class ImgSystem extends Renderer {
|
|
74
|
+
static systemName: string;
|
|
75
|
+
name: string;
|
|
76
|
+
imgs: {
|
|
77
|
+
[propName: number]: Sprite;
|
|
78
|
+
};
|
|
79
|
+
renderSystem: RendererSystem;
|
|
80
|
+
rendererManager: RendererManager;
|
|
81
|
+
containerManager: ContainerManager;
|
|
82
|
+
init(_params?: unknown): void;
|
|
83
|
+
update(_frame?: unknown): void;
|
|
84
|
+
rendererUpdate(gameObject: GameObject): void;
|
|
85
|
+
componentChanged(changed: ComponentChanged): Promise<void>;
|
|
86
|
+
private applySpriteLayout;
|
|
87
|
+
destroy(): void;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { }
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { type } from '@eva/inspector-decorator';
|
|
2
|
+
import { Component, resource, RESOURCE_TYPE, decorators, OBSERVER_TYPE } from '@eva/eva.js';
|
|
3
|
+
import { Renderer, RendererSystem } from '@eva/plugin-renderer';
|
|
4
|
+
import { Sprite } from '@eva/renderer-adapter';
|
|
5
|
+
import { Texture } from 'pixi.js';
|
|
6
|
+
|
|
7
|
+
/******************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */
|
|
21
|
+
|
|
22
|
+
function __decorate(decorators, target, key, desc) {
|
|
23
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
25
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function __metadata(metadataKey, metadataValue) {
|
|
30
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
34
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
35
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
36
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
37
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
38
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
39
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
44
|
+
var e = new Error(message);
|
|
45
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 图片组件
|
|
50
|
+
*
|
|
51
|
+
* Img 组件用于渲染单张图片。
|
|
52
|
+
* 它是最基础的图像渲染组件,适用于背景、UI 元素、静态贴图等场景。
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* // 渲染一张背景图
|
|
57
|
+
* const background = new GameObject('background');
|
|
58
|
+
* background.addComponent(new Img({
|
|
59
|
+
* resource: 'bgImage' // 资源名称
|
|
60
|
+
* }));
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
class Img$2 extends Component {
|
|
64
|
+
constructor(params) {
|
|
65
|
+
super(params);
|
|
66
|
+
/** 图片资源名称 */
|
|
67
|
+
this.resource = '';
|
|
68
|
+
/** 图片锚点 */
|
|
69
|
+
this.anchor = { x: 0, y: 0 };
|
|
70
|
+
this.init(params);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 初始化组件
|
|
74
|
+
* @param obj - 初始化参数
|
|
75
|
+
*
|
|
76
|
+
* 配置项包括 resource、anchor、width 和 height。
|
|
77
|
+
*/
|
|
78
|
+
init(obj) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
if (obj && obj.resource) {
|
|
81
|
+
this.resource = obj.resource;
|
|
82
|
+
}
|
|
83
|
+
if (obj && obj.anchor) {
|
|
84
|
+
this.anchor = {
|
|
85
|
+
x: (_a = obj.anchor.x) !== null && _a !== void 0 ? _a : this.anchor.x,
|
|
86
|
+
y: (_b = obj.anchor.y) !== null && _b !== void 0 ? _b : this.anchor.y,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
if (obj && typeof obj.width === 'number') {
|
|
90
|
+
this.width = obj.width;
|
|
91
|
+
}
|
|
92
|
+
if (obj && typeof obj.height === 'number') {
|
|
93
|
+
this.height = obj.height;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 切换当前图片资源。
|
|
98
|
+
*
|
|
99
|
+
* ImgSystem 会监听 resource 变化并刷新渲染纹理。
|
|
100
|
+
*
|
|
101
|
+
* @param resource - 图片资源名称
|
|
102
|
+
*/
|
|
103
|
+
load(resource) {
|
|
104
|
+
if (resource) {
|
|
105
|
+
this.resource = resource;
|
|
106
|
+
}
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
/** 设置图片锚点。 */
|
|
110
|
+
setAnchor(x, y = x) {
|
|
111
|
+
this.anchor.x = x;
|
|
112
|
+
this.anchor.y = y;
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
/** 设置显式渲染尺寸。 */
|
|
116
|
+
setSize(width, height) {
|
|
117
|
+
this.width = width;
|
|
118
|
+
this.height = height;
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
/** 释放组件持有的可编辑状态。渲染资源由 ImgSystem 统一管理。 */
|
|
122
|
+
destroy() {
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** 组件名称 */
|
|
127
|
+
Img$2.componentName = 'Img';
|
|
128
|
+
__decorate([
|
|
129
|
+
type('string'),
|
|
130
|
+
__metadata("design:type", String)
|
|
131
|
+
], Img$2.prototype, "resource", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
type('number'),
|
|
134
|
+
__metadata("design:type", Number)
|
|
135
|
+
], Img$2.prototype, "width", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
type('number'),
|
|
138
|
+
__metadata("design:type", Number)
|
|
139
|
+
], Img$2.prototype, "height", void 0);
|
|
140
|
+
|
|
141
|
+
resource.registerInstance(RESOURCE_TYPE.IMAGE, ({ data = {} }) => {
|
|
142
|
+
const { image } = data;
|
|
143
|
+
if (image) {
|
|
144
|
+
if (image instanceof Texture) {
|
|
145
|
+
return image;
|
|
146
|
+
}
|
|
147
|
+
const texture = Texture.from(image);
|
|
148
|
+
return texture;
|
|
149
|
+
}
|
|
150
|
+
return data;
|
|
151
|
+
});
|
|
152
|
+
resource.registerDestroy(RESOURCE_TYPE.IMAGE, ({ instance }) => {
|
|
153
|
+
if (instance) {
|
|
154
|
+
instance.destroy(true);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
let Img = class Img extends Renderer {
|
|
158
|
+
constructor() {
|
|
159
|
+
super(...arguments);
|
|
160
|
+
this.name = 'ImgSystem';
|
|
161
|
+
this.imgs = {};
|
|
162
|
+
}
|
|
163
|
+
init(_params) {
|
|
164
|
+
var _a, _b;
|
|
165
|
+
const renderSystem = (_b = (_a = this.game) === null || _a === void 0 ? void 0 : _a.getSystem) === null || _b === void 0 ? void 0 : _b.call(_a, RendererSystem);
|
|
166
|
+
if (!(renderSystem === null || renderSystem === void 0 ? void 0 : renderSystem.rendererManager))
|
|
167
|
+
return;
|
|
168
|
+
this.renderSystem = renderSystem;
|
|
169
|
+
this.renderSystem.rendererManager.register(this);
|
|
170
|
+
}
|
|
171
|
+
update(_frame) {
|
|
172
|
+
super.update(_frame);
|
|
173
|
+
}
|
|
174
|
+
rendererUpdate(gameObject) {
|
|
175
|
+
const component = gameObject.getComponent('Img');
|
|
176
|
+
this.applySpriteLayout(gameObject, component);
|
|
177
|
+
}
|
|
178
|
+
componentChanged(changed) {
|
|
179
|
+
var _a, _b, _c, _d, _e, _f;
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
if (changed.componentName === 'Img') {
|
|
182
|
+
const gameObjectId = changed.gameObject.id;
|
|
183
|
+
const component = changed.component;
|
|
184
|
+
if (changed.type === OBSERVER_TYPE.ADD) {
|
|
185
|
+
const sprite = new Sprite(null);
|
|
186
|
+
this.imgs[gameObjectId] = sprite;
|
|
187
|
+
(_b = (_a = this.containerManager) === null || _a === void 0 ? void 0 : _a.getContainer(gameObjectId)) === null || _b === void 0 ? void 0 : _b.addChildAt(sprite.sprite, 0);
|
|
188
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
189
|
+
const asyncId = this.increaseAsyncId(gameObjectId);
|
|
190
|
+
const { instance } = yield resource.getResource(component.resource);
|
|
191
|
+
if (!this.validateAsyncId(gameObjectId, asyncId))
|
|
192
|
+
return;
|
|
193
|
+
if (!instance) {
|
|
194
|
+
console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
sprite.image = instance;
|
|
198
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
199
|
+
}
|
|
200
|
+
else if (changed.type === OBSERVER_TYPE.CHANGE) {
|
|
201
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
202
|
+
if ((_d = (_c = changed.prop) === null || _c === void 0 ? void 0 : _c.prop) === null || _d === void 0 ? void 0 : _d.includes('resource')) {
|
|
203
|
+
const asyncId = this.increaseAsyncId(gameObjectId);
|
|
204
|
+
const { instance } = yield resource.getResource(component.resource);
|
|
205
|
+
if (!this.validateAsyncId(gameObjectId, asyncId))
|
|
206
|
+
return;
|
|
207
|
+
if (!instance) {
|
|
208
|
+
console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
this.imgs[gameObjectId].image = instance;
|
|
212
|
+
this.applySpriteLayout(changed.gameObject, component);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else if (changed.type === OBSERVER_TYPE.REMOVE) {
|
|
216
|
+
this.increaseAsyncId(gameObjectId);
|
|
217
|
+
const sprite = this.imgs[gameObjectId];
|
|
218
|
+
if (!sprite)
|
|
219
|
+
return;
|
|
220
|
+
(_f = (_e = this.containerManager) === null || _e === void 0 ? void 0 : _e.getContainer(gameObjectId)) === null || _f === void 0 ? void 0 : _f.removeChild(sprite.sprite);
|
|
221
|
+
sprite.sprite.destroy({ children: true });
|
|
222
|
+
delete this.imgs[gameObjectId];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
applySpriteLayout(gameObject, component) {
|
|
228
|
+
var _a, _b, _c, _d, _e;
|
|
229
|
+
const sprite = this.imgs[gameObject.id];
|
|
230
|
+
if (!sprite)
|
|
231
|
+
return;
|
|
232
|
+
const size = (_a = gameObject.transform) === null || _a === void 0 ? void 0 : _a.size;
|
|
233
|
+
const width = (_b = component === null || component === void 0 ? void 0 : component.width) !== null && _b !== void 0 ? _b : size === null || size === void 0 ? void 0 : size.width;
|
|
234
|
+
const height = (_c = component === null || component === void 0 ? void 0 : component.height) !== null && _c !== void 0 ? _c : size === null || size === void 0 ? void 0 : size.height;
|
|
235
|
+
if (typeof width === 'number') {
|
|
236
|
+
sprite.sprite.width = width;
|
|
237
|
+
}
|
|
238
|
+
if (typeof height === 'number') {
|
|
239
|
+
sprite.sprite.height = height;
|
|
240
|
+
}
|
|
241
|
+
const anchor = component === null || component === void 0 ? void 0 : component.anchor;
|
|
242
|
+
if (anchor) {
|
|
243
|
+
(_e = (_d = sprite.sprite.anchor) === null || _d === void 0 ? void 0 : _d.set) === null || _e === void 0 ? void 0 : _e.call(_d, anchor.x, anchor.y);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
destroy() {
|
|
247
|
+
var _a, _b;
|
|
248
|
+
for (const key in this.imgs) {
|
|
249
|
+
const sprite = this.imgs[key];
|
|
250
|
+
(_b = (_a = this.containerManager) === null || _a === void 0 ? void 0 : _a.getContainer(parseInt(key))) === null || _b === void 0 ? void 0 : _b.removeChild(sprite.sprite);
|
|
251
|
+
sprite.sprite.destroy({ children: true });
|
|
252
|
+
delete this.imgs[key];
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
Img.systemName = 'ImgSystem';
|
|
257
|
+
Img = __decorate([
|
|
258
|
+
decorators.componentObserver({
|
|
259
|
+
Img: ['resource', { prop: 'anchor', deep: true }, 'width', 'height'],
|
|
260
|
+
})
|
|
261
|
+
], Img);
|
|
262
|
+
var Img$1 = Img;
|
|
263
|
+
|
|
264
|
+
export { Img$2 as Img, Img$1 as ImgSystem };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-renderer-img",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.4",
|
|
4
4
|
"description": "@eva/plugin-renderer-img",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-img.esm.js",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"homepage": "https://eva.js.org",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@eva/inspector-decorator": "^2.0.0-beta.0",
|
|
22
|
-
"@eva/plugin-renderer": "2.1.0-beta.
|
|
23
|
-
"@eva/renderer-adapter": "2.1.0-beta.
|
|
24
|
-
"@eva/eva.js": "2.1.0-beta.
|
|
22
|
+
"@eva/plugin-renderer": "2.1.0-beta.4",
|
|
23
|
+
"@eva/renderer-adapter": "2.1.0-beta.4",
|
|
24
|
+
"@eva/eva.js": "2.1.0-beta.4",
|
|
25
25
|
"pixi.js": "^8.17.0"
|
|
26
26
|
}
|
|
27
27
|
}
|