@eva/plugin-renderer-graphics 2.0.0-beta.1 → 2.0.0-beta.10
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.graphics.js +33 -154
- package/dist/EVA.plugin.renderer.graphics.min.js +1 -1
- package/dist/plugin-renderer-graphics.cjs.js +42 -100
- package/dist/plugin-renderer-graphics.cjs.prod.js +16 -1
- package/dist/plugin-renderer-graphics.esm.js +44 -102
- package/package.json +3 -3
|
@@ -3,23 +3,18 @@ window.EVA.plugin = window.EVA.plugin || {};
|
|
|
3
3
|
window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
|
|
4
4
|
var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
|
|
5
5
|
'use strict';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
function __extends(d, b) {
|
|
17
|
-
extendStatics(d, b);
|
|
18
|
-
function __() {
|
|
19
|
-
this.constructor = d;
|
|
6
|
+
|
|
7
|
+
class Graphics$3 extends pixi_js.Graphics {}
|
|
8
|
+
class Graphics$2 extends eva_js.Component {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.graphics = null;
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
this.graphics = new Graphics$3();
|
|
20
15
|
}
|
|
21
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
22
16
|
}
|
|
17
|
+
Graphics$2.componentName = 'Graphics';
|
|
23
18
|
function __decorate(decorators, target, key, desc) {
|
|
24
19
|
var c = arguments.length,
|
|
25
20
|
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
@@ -54,150 +49,34 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
|
|
|
54
49
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
55
50
|
});
|
|
56
51
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (t[0] & 1) throw t[1];
|
|
62
|
-
return t[1];
|
|
63
|
-
},
|
|
64
|
-
trys: [],
|
|
65
|
-
ops: []
|
|
66
|
-
},
|
|
67
|
-
f,
|
|
68
|
-
y,
|
|
69
|
-
t,
|
|
70
|
-
g;
|
|
71
|
-
return g = {
|
|
72
|
-
next: verb(0),
|
|
73
|
-
"throw": verb(1),
|
|
74
|
-
"return": verb(2)
|
|
75
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
76
|
-
return this;
|
|
77
|
-
}), g;
|
|
78
|
-
function verb(n) {
|
|
79
|
-
return function (v) {
|
|
80
|
-
return step([n, v]);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function step(op) {
|
|
84
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
85
|
-
while (_) try {
|
|
86
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
87
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
88
|
-
switch (op[0]) {
|
|
89
|
-
case 0:
|
|
90
|
-
case 1:
|
|
91
|
-
t = op;
|
|
92
|
-
break;
|
|
93
|
-
case 4:
|
|
94
|
-
_.label++;
|
|
95
|
-
return {
|
|
96
|
-
value: op[1],
|
|
97
|
-
done: false
|
|
98
|
-
};
|
|
99
|
-
case 5:
|
|
100
|
-
_.label++;
|
|
101
|
-
y = op[1];
|
|
102
|
-
op = [0];
|
|
103
|
-
continue;
|
|
104
|
-
case 7:
|
|
105
|
-
op = _.ops.pop();
|
|
106
|
-
_.trys.pop();
|
|
107
|
-
continue;
|
|
108
|
-
default:
|
|
109
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
110
|
-
_ = 0;
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
114
|
-
_.label = op[1];
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
118
|
-
_.label = t[1];
|
|
119
|
-
t = op;
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
if (t && _.label < t[2]) {
|
|
123
|
-
_.label = t[2];
|
|
124
|
-
_.ops.push(op);
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
if (t[2]) _.ops.pop();
|
|
128
|
-
_.trys.pop();
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
op = body.call(thisArg, _);
|
|
132
|
-
} catch (e) {
|
|
133
|
-
op = [6, e];
|
|
134
|
-
y = 0;
|
|
135
|
-
} finally {
|
|
136
|
-
f = t = 0;
|
|
137
|
-
}
|
|
138
|
-
if (op[0] & 5) throw op[1];
|
|
139
|
-
return {
|
|
140
|
-
value: op[0] ? op[1] : void 0,
|
|
141
|
-
done: true
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
var Graphics$4 = function (_super) {
|
|
146
|
-
__extends(Graphics, _super);
|
|
147
|
-
function Graphics() {
|
|
148
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
52
|
+
let Graphics = class Graphics extends pluginRenderer.Renderer {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(...arguments);
|
|
55
|
+
this.name = 'Graphics';
|
|
149
56
|
}
|
|
150
|
-
|
|
151
|
-
}(pixi_js.Graphics);
|
|
152
|
-
var GraphicsEngine = Graphics$4;
|
|
153
|
-
var Graphics$2 = function (_super) {
|
|
154
|
-
__extends(Graphics, _super);
|
|
155
|
-
function Graphics() {
|
|
156
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
157
|
-
_this.graphics = null;
|
|
158
|
-
return _this;
|
|
159
|
-
}
|
|
160
|
-
Graphics.prototype.init = function () {
|
|
161
|
-
this.graphics = new GraphicsEngine();
|
|
162
|
-
};
|
|
163
|
-
Graphics.componentName = 'Graphics';
|
|
164
|
-
return Graphics;
|
|
165
|
-
}(eva_js.Component);
|
|
166
|
-
var Graphics$3 = Graphics$2;
|
|
167
|
-
var Graphics = function (_super) {
|
|
168
|
-
__extends(Graphics, _super);
|
|
169
|
-
function Graphics() {
|
|
170
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
171
|
-
_this.name = 'Graphics';
|
|
172
|
-
return _this;
|
|
173
|
-
}
|
|
174
|
-
Graphics.prototype.init = function () {
|
|
57
|
+
init() {
|
|
175
58
|
this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
|
|
176
59
|
this.renderSystem.rendererManager.register(this);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
return [2];
|
|
190
|
-
});
|
|
60
|
+
}
|
|
61
|
+
componentChanged(changed) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
|
|
64
|
+
this.containerManager.getContainer(changed.gameObject.id).addChildAt(changed.component.graphics, 0);
|
|
65
|
+
} else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
66
|
+
this.containerManager.getContainer(changed.gameObject.id).removeChild(changed.component.graphics);
|
|
67
|
+
changed.component.graphics.destroy({
|
|
68
|
+
children: true
|
|
69
|
+
});
|
|
70
|
+
}
|
|
191
71
|
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}(pluginRenderer.Renderer);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
Graphics.systemName = 'Graphics';
|
|
75
|
+
Graphics = __decorate([eva_js.decorators.componentObserver({
|
|
76
|
+
Graphics: ['graphics']
|
|
77
|
+
})], Graphics);
|
|
199
78
|
var Graphics$1 = Graphics;
|
|
200
|
-
exports.Graphics = Graphics$
|
|
79
|
+
exports.Graphics = Graphics$2;
|
|
201
80
|
exports.GraphicsSystem = Graphics$1;
|
|
202
81
|
Object.defineProperty(exports, '__esModule', {
|
|
203
82
|
value: true
|
|
@@ -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
|
|
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,r,t){"use strict";class i extends r.Graphics{}class c extends n.Component{constructor(){super(...arguments),this.graphics=null}init(){this.graphics=new i}}function o(e,n,r,t){return new(r||(r=Promise))((function(i,c){function o(e){try{a(t.next(e))}catch(e){c(e)}}function s(e){try{a(t.throw(e))}catch(e){c(e)}}function a(e){var n;e.done?i(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(o,s)}a((t=t.apply(e,n||[])).next())}))}c.componentName="Graphics";let s=class extends t.Renderer{constructor(){super(...arguments),this.name="Graphics"}init(){this.renderSystem=this.game.getSystem(t.RendererSystem),this.renderSystem.rendererManager.register(this)}componentChanged(e){return o(this,void 0,void 0,(function*(){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}))}))}};s.systemName="Graphics",s=function(e,n,r,t){var i,c=arguments.length,o=c<3?n:null===t?t=Object.getOwnPropertyDescriptor(n,r):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,n,r,t);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(c<3?i(o):c>3?i(n,r,o):i(n,r))||o);return c>3&&o&&Object.defineProperty(n,r,o),o}([n.decorators.componentObserver({Graphics:["graphics"]})],s);var a=s;return e.Graphics=c,e.GraphicsSystem=a,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;
|
|
@@ -6,6 +6,20 @@ var eva_js = require('@eva/eva.js');
|
|
|
6
6
|
var pixi_js = require('pixi.js');
|
|
7
7
|
var pluginRenderer = require('@eva/plugin-renderer');
|
|
8
8
|
|
|
9
|
+
class Graphics$3 extends pixi_js.Graphics {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class Graphics$2 extends eva_js.Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.graphics = null;
|
|
16
|
+
}
|
|
17
|
+
init() {
|
|
18
|
+
this.graphics = new Graphics$3();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
Graphics$2.componentName = 'Graphics';
|
|
22
|
+
|
|
9
23
|
/*! *****************************************************************************
|
|
10
24
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11
25
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -20,20 +34,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
20
34
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
21
35
|
and limitations under the License.
|
|
22
36
|
***************************************************************************** */
|
|
23
|
-
/* global Reflect, Promise */
|
|
24
|
-
|
|
25
|
-
var extendStatics = function(d, b) {
|
|
26
|
-
extendStatics = Object.setPrototypeOf ||
|
|
27
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
28
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
29
|
-
return extendStatics(d, b);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
function __extends(d, b) {
|
|
33
|
-
extendStatics(d, b);
|
|
34
|
-
function __() { this.constructor = d; }
|
|
35
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
-
}
|
|
37
37
|
|
|
38
38
|
function __decorate(decorators, target, key, desc) {
|
|
39
39
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -49,98 +49,40 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
49
49
|
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
50
50
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51
51
|
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function __generator(thisArg, body) {
|
|
55
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
56
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
57
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
58
|
-
function step(op) {
|
|
59
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
60
|
-
while (_) try {
|
|
61
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
62
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
63
|
-
switch (op[0]) {
|
|
64
|
-
case 0: case 1: t = op; break;
|
|
65
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
66
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
67
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
68
|
-
default:
|
|
69
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
70
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
71
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
72
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
73
|
-
if (t[2]) _.ops.pop();
|
|
74
|
-
_.trys.pop(); continue;
|
|
75
|
-
}
|
|
76
|
-
op = body.call(thisArg, _);
|
|
77
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
78
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
79
|
-
}
|
|
80
52
|
}
|
|
81
53
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
return Graphics;
|
|
88
|
-
}(pixi_js.Graphics));
|
|
89
|
-
var GraphicsEngine = Graphics$4;
|
|
90
|
-
|
|
91
|
-
var Graphics$2 = (function (_super) {
|
|
92
|
-
__extends(Graphics, _super);
|
|
93
|
-
function Graphics() {
|
|
94
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
95
|
-
_this.graphics = null;
|
|
96
|
-
return _this;
|
|
97
|
-
}
|
|
98
|
-
Graphics.prototype.init = function () {
|
|
99
|
-
this.graphics = new GraphicsEngine();
|
|
100
|
-
};
|
|
101
|
-
Graphics.componentName = 'Graphics';
|
|
102
|
-
return Graphics;
|
|
103
|
-
}(eva_js.Component));
|
|
104
|
-
var Graphics$3 = Graphics$2;
|
|
105
|
-
|
|
106
|
-
var Graphics = (function (_super) {
|
|
107
|
-
__extends(Graphics, _super);
|
|
108
|
-
function Graphics() {
|
|
109
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
110
|
-
_this.name = 'Graphics';
|
|
111
|
-
return _this;
|
|
54
|
+
let Graphics = class Graphics extends pluginRenderer.Renderer {
|
|
55
|
+
constructor() {
|
|
56
|
+
super(...arguments);
|
|
57
|
+
this.name = 'Graphics';
|
|
112
58
|
}
|
|
113
|
-
|
|
59
|
+
init() {
|
|
114
60
|
this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
|
|
115
61
|
this.renderSystem.rendererManager.register(this);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
return [2];
|
|
132
|
-
});
|
|
62
|
+
}
|
|
63
|
+
componentChanged(changed) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
|
|
66
|
+
this.containerManager
|
|
67
|
+
.getContainer(changed.gameObject.id)
|
|
68
|
+
.addChildAt(changed.component.graphics, 0);
|
|
69
|
+
}
|
|
70
|
+
else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
71
|
+
this.containerManager
|
|
72
|
+
.getContainer(changed.gameObject.id)
|
|
73
|
+
.removeChild(changed.component.graphics);
|
|
74
|
+
changed.component.graphics.destroy({ children: true });
|
|
75
|
+
}
|
|
133
76
|
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}(pluginRenderer.Renderer));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
Graphics.systemName = 'Graphics';
|
|
80
|
+
Graphics = __decorate([
|
|
81
|
+
eva_js.decorators.componentObserver({
|
|
82
|
+
Graphics: ['graphics'],
|
|
83
|
+
})
|
|
84
|
+
], Graphics);
|
|
143
85
|
var Graphics$1 = Graphics;
|
|
144
86
|
|
|
145
|
-
exports.Graphics = Graphics$
|
|
87
|
+
exports.Graphics = Graphics$2;
|
|
146
88
|
exports.GraphicsSystem = Graphics$1;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("pixi.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("pixi.js"),r=require("@eva/plugin-renderer");class n extends t.Graphics{}class i extends e.Component{constructor(){super(...arguments),this.graphics=null}init(){this.graphics=new n}}i.componentName="Graphics";let s=class extends r.Renderer{constructor(){super(...arguments),this.name="Graphics"}init(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)}componentChanged(t){return r=this,n=void 0,s=function*(){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}))},new((i=void 0)||(i=Promise))((function(e,t){function c(e){try{a(s.next(e))}catch(e){t(e)}}function o(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){t.done?e(t.value):new i((function(e){e(t.value)})).then(c,o)}a((s=s.apply(r,n||[])).next())}));var r,n,i,s}};s.systemName="Graphics",s=
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
|
|
8
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
+
|
|
13
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
+
and limitations under the License.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
function(e,t,r,n){var i,s=arguments.length,c=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(c=(s<3?i(c):s>3?i(t,r,c):i(t,r))||c);return s>3&&c&&Object.defineProperty(t,r,c),c}([e.decorators.componentObserver({Graphics:["graphics"]})],s);var c=s;exports.Graphics=i,exports.GraphicsSystem=c;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { Component, decorators, OBSERVER_TYPE } from '@eva/eva.js';
|
|
2
|
-
import { Graphics as Graphics$
|
|
3
|
-
import {
|
|
2
|
+
import { Graphics as Graphics$4 } from 'pixi.js';
|
|
3
|
+
import { Renderer, RendererSystem } from '@eva/plugin-renderer';
|
|
4
|
+
|
|
5
|
+
class Graphics$3 extends Graphics$4 {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
class Graphics$2 extends Component {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.graphics = null;
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
this.graphics = new Graphics$3();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
Graphics$2.componentName = 'Graphics';
|
|
4
18
|
|
|
5
19
|
/*! *****************************************************************************
|
|
6
20
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -16,20 +30,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
16
30
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
17
31
|
and limitations under the License.
|
|
18
32
|
***************************************************************************** */
|
|
19
|
-
/* global Reflect, Promise */
|
|
20
|
-
|
|
21
|
-
var extendStatics = function(d, b) {
|
|
22
|
-
extendStatics = Object.setPrototypeOf ||
|
|
23
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
24
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
25
|
-
return extendStatics(d, b);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
function __extends(d, b) {
|
|
29
|
-
extendStatics(d, b);
|
|
30
|
-
function __() { this.constructor = d; }
|
|
31
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
32
|
-
}
|
|
33
33
|
|
|
34
34
|
function __decorate(decorators, target, key, desc) {
|
|
35
35
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -45,97 +45,39 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
45
45
|
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
46
46
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
47
|
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function __generator(thisArg, body) {
|
|
51
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
52
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
53
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
|
-
function step(op) {
|
|
55
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (_) try {
|
|
57
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
-
switch (op[0]) {
|
|
60
|
-
case 0: case 1: t = op; break;
|
|
61
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
62
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
63
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
64
|
-
default:
|
|
65
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
66
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
67
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
68
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
69
|
-
if (t[2]) _.ops.pop();
|
|
70
|
-
_.trys.pop(); continue;
|
|
71
|
-
}
|
|
72
|
-
op = body.call(thisArg, _);
|
|
73
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
74
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
|
-
}
|
|
76
48
|
}
|
|
77
49
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
return Graphics;
|
|
84
|
-
}(Graphics$5));
|
|
85
|
-
var GraphicsEngine = Graphics$4;
|
|
86
|
-
|
|
87
|
-
var Graphics$2 = (function (_super) {
|
|
88
|
-
__extends(Graphics, _super);
|
|
89
|
-
function Graphics() {
|
|
90
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
91
|
-
_this.graphics = null;
|
|
92
|
-
return _this;
|
|
93
|
-
}
|
|
94
|
-
Graphics.prototype.init = function () {
|
|
95
|
-
this.graphics = new GraphicsEngine();
|
|
96
|
-
};
|
|
97
|
-
Graphics.componentName = 'Graphics';
|
|
98
|
-
return Graphics;
|
|
99
|
-
}(Component));
|
|
100
|
-
var Graphics$3 = Graphics$2;
|
|
101
|
-
|
|
102
|
-
var Graphics = (function (_super) {
|
|
103
|
-
__extends(Graphics, _super);
|
|
104
|
-
function Graphics() {
|
|
105
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
106
|
-
_this.name = 'Graphics';
|
|
107
|
-
return _this;
|
|
50
|
+
let Graphics = class Graphics extends Renderer {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
|
+
this.name = 'Graphics';
|
|
108
54
|
}
|
|
109
|
-
|
|
55
|
+
init() {
|
|
110
56
|
this.renderSystem = this.game.getSystem(RendererSystem);
|
|
111
57
|
this.renderSystem.rendererManager.register(this);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
return [2];
|
|
128
|
-
});
|
|
58
|
+
}
|
|
59
|
+
componentChanged(changed) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
if (changed.type === OBSERVER_TYPE.ADD) {
|
|
62
|
+
this.containerManager
|
|
63
|
+
.getContainer(changed.gameObject.id)
|
|
64
|
+
.addChildAt(changed.component.graphics, 0);
|
|
65
|
+
}
|
|
66
|
+
else if (changed.type === OBSERVER_TYPE.REMOVE) {
|
|
67
|
+
this.containerManager
|
|
68
|
+
.getContainer(changed.gameObject.id)
|
|
69
|
+
.removeChild(changed.component.graphics);
|
|
70
|
+
changed.component.graphics.destroy({ children: true });
|
|
71
|
+
}
|
|
129
72
|
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}(Renderer));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
Graphics.systemName = 'Graphics';
|
|
76
|
+
Graphics = __decorate([
|
|
77
|
+
decorators.componentObserver({
|
|
78
|
+
Graphics: ['graphics'],
|
|
79
|
+
})
|
|
80
|
+
], Graphics);
|
|
139
81
|
var Graphics$1 = Graphics;
|
|
140
82
|
|
|
141
|
-
export { Graphics$
|
|
83
|
+
export { Graphics$2 as Graphics, Graphics$1 as GraphicsSystem };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-renderer-graphics",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.10",
|
|
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": "2.0.0-beta.
|
|
22
|
-
"@eva/eva.js": "2.0.0-beta.
|
|
21
|
+
"@eva/plugin-renderer": "2.0.0-beta.10",
|
|
22
|
+
"@eva/eva.js": "2.0.0-beta.10"
|
|
23
23
|
}
|
|
24
24
|
}
|