@safe-engine/cocos 2.5.7 → 2.5.9
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/core/Scene.d.ts +1 -0
- package/dist/core/Scene.d.ts.map +1 -1
- package/dist/core/Scene.js +1 -0
- package/dist/helper/utils.d.ts +1 -1
- package/dist/helper/utils.d.ts.map +1 -1
- package/dist/helper/utils.js +4 -1
- package/dist/spine/SpineSkeleton.d.ts.map +1 -1
- package/dist/spine/SpineSkeleton.js +1 -2
- package/dist/spine/spine-cocos/CCSkeleton.d.ts +3 -3
- package/dist/spine/spine-cocos/CCSkeleton.d.ts.map +1 -1
- package/dist/spine/spine-cocos/CCSkeleton.js +14 -6
- package/package.json +1 -1
- package/dist/core/index.d.ts +0 -6
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -5
- package/dist/dragonbones/PixiDragonBonesSprite.d.ts +0 -19
- package/dist/dragonbones/PixiDragonBonesSprite.d.ts.map +0 -1
- package/dist/dragonbones/PixiDragonBonesSprite.js +0 -75
- package/dist/gworld/EnhancedComponent.d.ts +0 -22
- package/dist/gworld/EnhancedComponent.d.ts.map +0 -1
- package/dist/gworld/EnhancedComponent.js +0 -44
- package/dist/gworld/NodeComp.d.ts +0 -153
- package/dist/gworld/NodeComp.d.ts.map +0 -1
- package/dist/gworld/NodeComp.js +0 -337
- package/dist/gworld/NodePool.d.ts +0 -9
- package/dist/gworld/NodePool.d.ts.map +0 -1
- package/dist/gworld/NodePool.js +0 -23
- package/dist/gworld/Scene.d.ts +0 -5
- package/dist/gworld/Scene.d.ts.map +0 -1
- package/dist/gworld/Scene.js +0 -14
- package/dist/gworld/decorator.d.ts +0 -8
- package/dist/gworld/decorator.d.ts.map +0 -1
- package/dist/gworld/decorator.js +0 -12
- package/dist/gworld/index.d.ts +0 -8
- package/dist/gworld/index.d.ts.map +0 -1
- package/dist/gworld/index.js +0 -14
- package/dist/safex.d.ts +0 -10
- package/dist/safex.d.ts.map +0 -1
- package/dist/safex.js +0 -1
- package/dist/spine/CCSkeleton.d.ts +0 -189
- package/dist/spine/CCSkeleton.d.ts.map +0 -1
- package/dist/spine/CCSkeleton.js +0 -320
- package/dist/spine/CCSkeletonAnimation.d.ts +0 -146
- package/dist/spine/CCSkeletonAnimation.d.ts.map +0 -1
- package/dist/spine/CCSkeletonAnimation.js +0 -311
- package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts +0 -2
- package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts.map +0 -1
- package/dist/spine/CCSkeletonCanvasRenderCmd.js +0 -228
- package/dist/spine/CCSkeletonTexture.d.ts +0 -25
- package/dist/spine/CCSkeletonTexture.d.ts.map +0 -1
- package/dist/spine/CCSkeletonTexture.js +0 -60
- package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts +0 -28
- package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts.map +0 -1
- package/dist/spine/CCSkeletonWebGLRenderCmd.js +0 -277
- package/dist/spine/PixiSpineSprite.d.ts +0 -19
- package/dist/spine/PixiSpineSprite.d.ts.map +0 -1
- package/dist/spine/PixiSpineSprite.js +0 -72
package/dist/gworld/NodeComp.js
DELETED
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import { instantiate } from '../helper/utils';
|
|
2
|
-
import { ExtraDataComp } from '../norender';
|
|
3
|
-
import { Vec2 } from '../polyfills';
|
|
4
|
-
export class NodeComp {
|
|
5
|
-
entity;
|
|
6
|
-
instance;
|
|
7
|
-
parent;
|
|
8
|
-
children = [];
|
|
9
|
-
name;
|
|
10
|
-
_group;
|
|
11
|
-
_active = true;
|
|
12
|
-
constructor(instance, entity) {
|
|
13
|
-
this.entity = entity;
|
|
14
|
-
this.instance = instance;
|
|
15
|
-
}
|
|
16
|
-
get uuid() {
|
|
17
|
-
return this.entity.id;
|
|
18
|
-
}
|
|
19
|
-
get position() {
|
|
20
|
-
return Vec2(this.instance.getPosition());
|
|
21
|
-
}
|
|
22
|
-
set position(val) {
|
|
23
|
-
this.instance.setPosition(val.x, val.y);
|
|
24
|
-
}
|
|
25
|
-
set xy(val) {
|
|
26
|
-
this.instance.setPosition(val[0], val[1]);
|
|
27
|
-
}
|
|
28
|
-
get posX() {
|
|
29
|
-
return this.instance.getPositionX();
|
|
30
|
-
}
|
|
31
|
-
set posX(val) {
|
|
32
|
-
this.instance.setPositionX(val);
|
|
33
|
-
}
|
|
34
|
-
get posY() {
|
|
35
|
-
return this.instance.getPositionY();
|
|
36
|
-
}
|
|
37
|
-
set posY(val) {
|
|
38
|
-
this.instance.setPositionY(val);
|
|
39
|
-
}
|
|
40
|
-
get scale() {
|
|
41
|
-
return this.instance.getScale();
|
|
42
|
-
}
|
|
43
|
-
set scale(val) {
|
|
44
|
-
this.instance.setScale(val, val);
|
|
45
|
-
}
|
|
46
|
-
get scaleX() {
|
|
47
|
-
return this.instance.getScaleX();
|
|
48
|
-
}
|
|
49
|
-
set scaleX(val) {
|
|
50
|
-
this.instance.setScaleX(val);
|
|
51
|
-
}
|
|
52
|
-
get scaleY() {
|
|
53
|
-
return this.instance.getScaleY();
|
|
54
|
-
}
|
|
55
|
-
set scaleY(val) {
|
|
56
|
-
this.instance.setScaleY(val);
|
|
57
|
-
}
|
|
58
|
-
get anchorX() {
|
|
59
|
-
return this.instance.anchorX;
|
|
60
|
-
}
|
|
61
|
-
set anchorX(val) {
|
|
62
|
-
this.instance.anchorX = val;
|
|
63
|
-
}
|
|
64
|
-
get anchorY() {
|
|
65
|
-
return this.instance.anchorY;
|
|
66
|
-
}
|
|
67
|
-
set anchorY(val) {
|
|
68
|
-
this.instance.anchorY = val;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Returns the angle of the node in degrees. 0 is the default rotation angle. Positive values rotate node clockwise.
|
|
72
|
-
* @function
|
|
73
|
-
* @return {Number} The rotation of the node in degrees.
|
|
74
|
-
*/
|
|
75
|
-
get rotation() {
|
|
76
|
-
return this.instance.getRotation();
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
* Sets the X angle of the node in degrees which performs a horizontal rotational skew.
|
|
81
|
-
* (support only in WebGL rendering mode)
|
|
82
|
-
* 0 is the default rotation angle.
|
|
83
|
-
* Positive values rotate node clockwise, and negative values for anti-clockwise.
|
|
84
|
-
*
|
|
85
|
-
* @param {Number} degrees The X rotation in degrees which performs a horizontal rotational skew.
|
|
86
|
-
*/
|
|
87
|
-
set rotation(val) {
|
|
88
|
-
this.instance.setRotation(val);
|
|
89
|
-
}
|
|
90
|
-
get color() {
|
|
91
|
-
return this.instance.getColor();
|
|
92
|
-
}
|
|
93
|
-
set color(val) {
|
|
94
|
-
this.instance.setColor(val);
|
|
95
|
-
}
|
|
96
|
-
get opacity() {
|
|
97
|
-
return this.instance.getOpacity();
|
|
98
|
-
}
|
|
99
|
-
set opacity(val) {
|
|
100
|
-
this.instance.setOpacity(val);
|
|
101
|
-
}
|
|
102
|
-
get active() {
|
|
103
|
-
if (!cc.sys.isObjectValid(this.instance) || !this._active)
|
|
104
|
-
return false;
|
|
105
|
-
let p = this.parent;
|
|
106
|
-
while (p) {
|
|
107
|
-
if (!p.active)
|
|
108
|
-
return false;
|
|
109
|
-
p = p.parent;
|
|
110
|
-
}
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
set active(val) {
|
|
114
|
-
if (!cc.sys.isObjectValid(this.instance)) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
this._active = val;
|
|
118
|
-
if (this.instance instanceof ccui.Widget) {
|
|
119
|
-
this.instance.setEnabled(val);
|
|
120
|
-
}
|
|
121
|
-
this.instance.setVisible(val);
|
|
122
|
-
}
|
|
123
|
-
get group() {
|
|
124
|
-
return this._group;
|
|
125
|
-
}
|
|
126
|
-
set group(val) {
|
|
127
|
-
this._group = val;
|
|
128
|
-
}
|
|
129
|
-
get width() {
|
|
130
|
-
return this.instance.width;
|
|
131
|
-
}
|
|
132
|
-
set width(val) {
|
|
133
|
-
this.instance.setContentSize(val, this.height);
|
|
134
|
-
}
|
|
135
|
-
get height() {
|
|
136
|
-
return this.instance.height;
|
|
137
|
-
}
|
|
138
|
-
set height(val) {
|
|
139
|
-
this.instance.setContentSize(val, this.width);
|
|
140
|
-
}
|
|
141
|
-
get zIndex() {
|
|
142
|
-
return this.instance.zIndex;
|
|
143
|
-
}
|
|
144
|
-
set zIndex(val) {
|
|
145
|
-
this.instance.zIndex = val;
|
|
146
|
-
}
|
|
147
|
-
get childrenCount() {
|
|
148
|
-
return this.children.length;
|
|
149
|
-
}
|
|
150
|
-
destroy() {
|
|
151
|
-
this.removeFromParent(true);
|
|
152
|
-
}
|
|
153
|
-
addComponent(instance) {
|
|
154
|
-
return this.entity.assign(instance);
|
|
155
|
-
}
|
|
156
|
-
getComponent(component) {
|
|
157
|
-
return this.entity.getComponent(component);
|
|
158
|
-
}
|
|
159
|
-
getComponentsInChildren(component) {
|
|
160
|
-
if (!this.children.length) {
|
|
161
|
-
return [];
|
|
162
|
-
}
|
|
163
|
-
const listHave = this.children.filter((child) => {
|
|
164
|
-
return child.getComponent(component);
|
|
165
|
-
});
|
|
166
|
-
return listHave.map((node) => node.getComponent(component));
|
|
167
|
-
}
|
|
168
|
-
getComponentInChildren(component) {
|
|
169
|
-
return this.getComponentsInChildren(component)[0];
|
|
170
|
-
}
|
|
171
|
-
hasComponentInChildren(component) {
|
|
172
|
-
if (!this.children.length) {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
return this.children.some((child) => {
|
|
176
|
-
return child.getComponent(component);
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
getPercent() {
|
|
180
|
-
if (this.instance instanceof ccui.LoadingBar) {
|
|
181
|
-
return this.instance.getPercent();
|
|
182
|
-
}
|
|
183
|
-
return 0;
|
|
184
|
-
}
|
|
185
|
-
setPercent(val) {
|
|
186
|
-
if (this.instance instanceof ccui.LoadingBar) {
|
|
187
|
-
return this.instance.setPercent(val);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
setTouchEnabled(enabled) {
|
|
191
|
-
if (!cc.sys.isObjectValid(this.instance)) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
if (this.instance instanceof ccui.Widget) {
|
|
195
|
-
this.instance.setTouchEnabled(enabled);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
addTouchEventListener(cb) {
|
|
199
|
-
if (!cc.sys.isObjectValid(this.instance)) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
if (this.instance instanceof ccui.Widget) {
|
|
203
|
-
this.instance.addTouchEventListener(cb);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
convertToNodeSpace(point) {
|
|
207
|
-
const { x, y } = this.instance.convertToNodeSpace(point);
|
|
208
|
-
return Vec2(x, y);
|
|
209
|
-
}
|
|
210
|
-
convertToNodeSpaceAR(point) {
|
|
211
|
-
const { x, y } = this.instance.convertToNodeSpaceAR(point);
|
|
212
|
-
return Vec2(x, y);
|
|
213
|
-
}
|
|
214
|
-
convertToWorldSpaceAR(point) {
|
|
215
|
-
const { x, y } = this.instance.convertToWorldSpaceAR(point);
|
|
216
|
-
return Vec2(x, y);
|
|
217
|
-
}
|
|
218
|
-
getPosition() {
|
|
219
|
-
return this.instance.getPosition();
|
|
220
|
-
}
|
|
221
|
-
setPosition(x, y) {
|
|
222
|
-
this.instance.setPosition(x, y);
|
|
223
|
-
}
|
|
224
|
-
setRotation(deg) {
|
|
225
|
-
this.instance.setRotation(deg);
|
|
226
|
-
}
|
|
227
|
-
getRotation() {
|
|
228
|
-
return this.instance.getRotation();
|
|
229
|
-
}
|
|
230
|
-
setAnchorPoint(point, y) {
|
|
231
|
-
this.instance.setAnchorPoint(point, y);
|
|
232
|
-
}
|
|
233
|
-
getAnchorPoint() {
|
|
234
|
-
return this.instance.getAnchorPoint();
|
|
235
|
-
}
|
|
236
|
-
getBoundingBox() {
|
|
237
|
-
const box = this.instance.getBoundingBox();
|
|
238
|
-
box.contains = function (point) {
|
|
239
|
-
return this.x <= point.x && this.x + this.width >= point.x && this.y <= point.y && this.y + this.height >= point.y;
|
|
240
|
-
};
|
|
241
|
-
return box;
|
|
242
|
-
}
|
|
243
|
-
getContentSize() {
|
|
244
|
-
return this.instance.getContentSize();
|
|
245
|
-
}
|
|
246
|
-
setContentSize(size, height) {
|
|
247
|
-
this.instance.setContentSize(size, height);
|
|
248
|
-
if (this.instance instanceof cc.ClippingNode) {
|
|
249
|
-
const hw = (size.width || size) * 0.5;
|
|
250
|
-
const hh = (size.height || height) * 0.5;
|
|
251
|
-
const stencil = new cc.DrawNode();
|
|
252
|
-
const rectangle = [cc.p(-hw, -hh), cc.p(hw, -hh), cc.p(hw, hh), cc.p(-hw, hh)];
|
|
253
|
-
stencil.drawPoly(rectangle, cc.Color.WHITE, 0, cc.Color.WHITE);
|
|
254
|
-
// stencil.drawDot(cc.p(-height * 0.5, -height * 0.5), height, cc.Color.WHITE);
|
|
255
|
-
this.instance.stencil = stencil;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
setColor(color) {
|
|
259
|
-
this.instance.setColor(color);
|
|
260
|
-
}
|
|
261
|
-
setScale(scaleX, scaleY) {
|
|
262
|
-
this.instance.setScale(scaleX, scaleY || scaleX);
|
|
263
|
-
}
|
|
264
|
-
runAction(atc) {
|
|
265
|
-
this.instance.runAction(atc);
|
|
266
|
-
}
|
|
267
|
-
stopAllActions() {
|
|
268
|
-
this.instance.stopAllActions();
|
|
269
|
-
}
|
|
270
|
-
pauseAllActionsAndSchedule() {
|
|
271
|
-
this.instance.pause();
|
|
272
|
-
this.instance.unscheduleUpdate();
|
|
273
|
-
}
|
|
274
|
-
resumeAllActionsAndSchedule() {
|
|
275
|
-
this.instance.resume();
|
|
276
|
-
this.instance.scheduleUpdate();
|
|
277
|
-
}
|
|
278
|
-
removeFromParent(cleanup) {
|
|
279
|
-
this.active = false;
|
|
280
|
-
if (this.parent) {
|
|
281
|
-
this.parent.children = this.parent.children.filter(({ entity }) => entity.id !== this.entity.id);
|
|
282
|
-
}
|
|
283
|
-
if (cleanup) {
|
|
284
|
-
this.children.forEach((child) => {
|
|
285
|
-
child.destroy();
|
|
286
|
-
});
|
|
287
|
-
this.parent = null;
|
|
288
|
-
this.entity.destroy();
|
|
289
|
-
this.stopAllActions();
|
|
290
|
-
this.instance.removeFromParent(cleanup);
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
this.stopAllActions();
|
|
294
|
-
this.instance.removeFromParent();
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
addChild(child) {
|
|
298
|
-
child._active = true;
|
|
299
|
-
child.parent = this;
|
|
300
|
-
this.children.push(child);
|
|
301
|
-
this.instance.addChild(child.instance);
|
|
302
|
-
}
|
|
303
|
-
removeAllChildren(cleanup) {
|
|
304
|
-
this.children.forEach((child) => {
|
|
305
|
-
child.removeFromParent(cleanup);
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
getData(key) {
|
|
309
|
-
const data = this.getComponent(ExtraDataComp);
|
|
310
|
-
if (!data)
|
|
311
|
-
throw Error('need add ExtraDataComp to Node');
|
|
312
|
-
return data.getData(key);
|
|
313
|
-
}
|
|
314
|
-
setData(key, value) {
|
|
315
|
-
const data = this.getComponent(ExtraDataComp);
|
|
316
|
-
if (!data) {
|
|
317
|
-
this.addComponent(instantiate(ExtraDataComp, { key, value }));
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
data.setData(key, value);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
removeData(key) {
|
|
324
|
-
const data = this.getComponent(ExtraDataComp);
|
|
325
|
-
if (data) {
|
|
326
|
-
data.removeData(key);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
resolveComponent(component) {
|
|
330
|
-
if (component.constructor.hasRender) {
|
|
331
|
-
this.addChild(component.node);
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
this.addComponent(component);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodePool.d.ts","sourceRoot":"","sources":["../../src/gworld/NodePool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,qBAAa,QAAQ;IACnB,KAAK,EAAE,QAAQ,EAAE,CAAK;IAEtB,GAAG,CAAC,IAAI,EAAE,QAAQ;IAQlB,GAAG,IAAI,QAAQ;IAOf,IAAI;IAIJ,KAAK;CAIN"}
|
package/dist/gworld/NodePool.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export class NodePool {
|
|
2
|
-
items = [];
|
|
3
|
-
put(node) {
|
|
4
|
-
if (node) {
|
|
5
|
-
node.removeFromParent();
|
|
6
|
-
node.entity.immortal = true;
|
|
7
|
-
this.items.push(node);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
get() {
|
|
11
|
-
const node = this.items.pop();
|
|
12
|
-
node.entity.immortal = false;
|
|
13
|
-
node.active = true;
|
|
14
|
-
return node;
|
|
15
|
-
}
|
|
16
|
-
size() {
|
|
17
|
-
return this.items.length;
|
|
18
|
-
}
|
|
19
|
-
clear() {
|
|
20
|
-
this.items.forEach((node) => node.destroy());
|
|
21
|
-
this.items.length = 0;
|
|
22
|
-
}
|
|
23
|
-
}
|
package/dist/gworld/Scene.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../src/gworld/Scene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,qBAAa,cAAe,SAAQ,iBAAiB;IACnD,MAAM;CASP"}
|
package/dist/gworld/Scene.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { GameWorld } from '.';
|
|
2
|
-
import { EnhancedComponent } from './EnhancedComponent';
|
|
3
|
-
import { NodeComp } from './NodeComp';
|
|
4
|
-
export class SceneComponent extends EnhancedComponent {
|
|
5
|
-
render() {
|
|
6
|
-
const world = GameWorld.Instance;
|
|
7
|
-
world.entities.reset();
|
|
8
|
-
const root = world.entities.create();
|
|
9
|
-
const node = root.assign(new NodeComp(cc.director.getRunningScene(), root));
|
|
10
|
-
const sceneComponent = root.assign(this);
|
|
11
|
-
sceneComponent.node = node;
|
|
12
|
-
return sceneComponent;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { EnhancedComponent, NodeComp } from '.';
|
|
2
|
-
export declare class NoRenderComponentX<Props = object, C extends cc.Node = cc.Node> extends EnhancedComponent<Props, NodeComp<C>> {
|
|
3
|
-
static hasRender: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare class ComponentX<Props = object, C extends cc.Node = cc.Node> extends EnhancedComponent<Props, NodeComp<C>> {
|
|
6
|
-
render?(): this;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=decorator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../src/gworld/decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,QAAQ,EAAE,MAAM,GAAG,CAAA;AAE1D,qBAAa,kBAAkB,CAAC,KAAK,GAAG,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAE,SAAQ,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxH,MAAM,CAAC,SAAS,UAAQ;CACzB;AAED,qBAAa,UAAU,CAAC,KAAK,GAAG,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAE,SAAQ,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAChH,MAAM,CAAC;CAMR"}
|
package/dist/gworld/decorator.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { EnhancedComponent, GameWorld } from '.';
|
|
2
|
-
export class NoRenderComponentX extends EnhancedComponent {
|
|
3
|
-
static hasRender = false;
|
|
4
|
-
}
|
|
5
|
-
export class ComponentX extends EnhancedComponent {
|
|
6
|
-
render() {
|
|
7
|
-
const world = GameWorld.Instance;
|
|
8
|
-
const root = world.entities.create();
|
|
9
|
-
const comp = root.assign(this);
|
|
10
|
-
return comp;
|
|
11
|
-
}
|
|
12
|
-
}
|
package/dist/gworld/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Constructor, System, World } from 'entityx-ts';
|
|
2
|
-
export declare class GameWorld extends World {
|
|
3
|
-
listUpdate: (System | Constructor<System>)[];
|
|
4
|
-
update(dt: number): void;
|
|
5
|
-
private static _instance;
|
|
6
|
-
static get Instance(): GameWorld;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gworld/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvD,qBAAa,SAAU,SAAQ,KAAK;IAClC,UAAU,EAAE,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,CAAK;IACjD,MAAM,CAAC,EAAE,EAAE,MAAM;IAMjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAW;IAEnC,WAAkB,QAAQ,cAGzB;CACF"}
|
package/dist/gworld/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { World } from 'entityx-ts';
|
|
2
|
-
export class GameWorld extends World {
|
|
3
|
-
listUpdate = [];
|
|
4
|
-
update(dt) {
|
|
5
|
-
this.listUpdate.forEach((system) => {
|
|
6
|
-
this.systems.update(system, dt);
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
static _instance;
|
|
10
|
-
static get Instance() {
|
|
11
|
-
// Do you need arguments? Make it a regular static method instead.
|
|
12
|
-
return this._instance || (this._instance = new this());
|
|
13
|
-
}
|
|
14
|
-
}
|
package/dist/safex.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Color4B, NodeComp } from '.';
|
|
2
|
-
export type ColorSource = ReturnType<typeof Color4B>;
|
|
3
|
-
export interface BaseComponentProps<T> {
|
|
4
|
-
$ref?: T;
|
|
5
|
-
$push?: T[];
|
|
6
|
-
$refNode?: NodeComp;
|
|
7
|
-
$pushNode?: NodeComp[];
|
|
8
|
-
node?: Partial<NodeComp>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=safex.d.ts.map
|
package/dist/safex.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"safex.d.ts","sourceRoot":"","sources":["../src/safex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAA;AAErC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAA;AAEpD,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CAEzB"}
|
package/dist/safex.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/****************************************************************************
|
|
2
|
-
Copyright (c) 2011-2012 cocos2d-x.org
|
|
3
|
-
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
|
4
|
-
Copyright (c) 2014 Shengxiang Chen (Nero Chan)
|
|
5
|
-
|
|
6
|
-
http://www.cocos2d-x.org
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
****************************************************************************/
|
|
26
|
-
/**
|
|
27
|
-
* The main namespace of Spine, all classes, functions, properties and constants of Spine are defined in this namespace
|
|
28
|
-
* @namespace
|
|
29
|
-
* @name
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* <p>
|
|
33
|
-
* The skeleton of Spine. <br/>
|
|
34
|
-
* Skeleton has a reference to a SkeletonData and stores the state for skeleton instance,
|
|
35
|
-
* which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible. <br/>
|
|
36
|
-
* Multiple skeletons can use the same SkeletonData (which includes all animations, skins, and attachments). <br/>
|
|
37
|
-
* </p>
|
|
38
|
-
* @class
|
|
39
|
-
* @extends cc.Node
|
|
40
|
-
*/
|
|
41
|
-
export declare class Skeleton extends cc.Node {
|
|
42
|
-
_skeleton: any;
|
|
43
|
-
_rootBone: any;
|
|
44
|
-
_timeScale: number;
|
|
45
|
-
_debugSlots: boolean;
|
|
46
|
-
_debugBones: boolean;
|
|
47
|
-
_premultipliedAlpha: any;
|
|
48
|
-
_ownsSkeletonData: any;
|
|
49
|
-
_atlas: any;
|
|
50
|
-
constructor(skeletonDataFile?: string, atlasFile?: string, scale?: number);
|
|
51
|
-
_createRenderCmd(): any;
|
|
52
|
-
onEnter(): void;
|
|
53
|
-
onExit(): void;
|
|
54
|
-
/**
|
|
55
|
-
* Sets whether open debug slots.
|
|
56
|
-
* @param {boolean} enable true to open, false to close.
|
|
57
|
-
*/
|
|
58
|
-
setDebugSolots(enable: boolean): void;
|
|
59
|
-
/**
|
|
60
|
-
* Sets whether open debug bones.
|
|
61
|
-
* @param {boolean} enable
|
|
62
|
-
*/
|
|
63
|
-
setDebugBones(enable: boolean): void;
|
|
64
|
-
/**
|
|
65
|
-
* Sets whether open debug slots.
|
|
66
|
-
* @param {boolean} enabled true to open, false to close.
|
|
67
|
-
*/
|
|
68
|
-
setDebugSlotsEnabled(enabled: boolean): void;
|
|
69
|
-
/**
|
|
70
|
-
* Gets whether open debug slots.
|
|
71
|
-
* @returns {boolean} true to open, false to close.
|
|
72
|
-
*/
|
|
73
|
-
getDebugSlotsEnabled(): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Sets whether open debug bones.
|
|
76
|
-
* @param {boolean} enabled
|
|
77
|
-
*/
|
|
78
|
-
setDebugBonesEnabled(enabled: boolean): void;
|
|
79
|
-
/**
|
|
80
|
-
* Gets whether open debug bones.
|
|
81
|
-
* @returns {boolean} true to open, false to close.
|
|
82
|
-
*/
|
|
83
|
-
getDebugBonesEnabled(): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Sets the time scale of Skeleton.
|
|
86
|
-
* @param {Number} scale
|
|
87
|
-
*/
|
|
88
|
-
setTimeScale(scale: number): void;
|
|
89
|
-
getTimeScale(): number;
|
|
90
|
-
/**
|
|
91
|
-
* Initializes Skeleton with Data.
|
|
92
|
-
* @param {.spine.SkeletonData|String} skeletonDataFile
|
|
93
|
-
* @param {String|spine.Atlas|spine.SkeletonData} atlasFile atlas filename or atlas data or owns SkeletonData
|
|
94
|
-
* @param {Number} [scale] scale can be specified on the JSON or binary loader which will scale the bone positions, image sizes, and animation translations.
|
|
95
|
-
*/
|
|
96
|
-
initWithArgs(skeletonDataFile: string, atlasFile: string, scale?: number): void;
|
|
97
|
-
/**
|
|
98
|
-
* Returns the bounding box of Skeleton.
|
|
99
|
-
* @returns {cc.Rect}
|
|
100
|
-
*/
|
|
101
|
-
getBoundingBox(): cc.Rect;
|
|
102
|
-
/**
|
|
103
|
-
* Computes the world SRT from the local SRT for each bone.
|
|
104
|
-
*/
|
|
105
|
-
updateWorldTransform(): void;
|
|
106
|
-
/**
|
|
107
|
-
* Sets the bones and slots to the setup pose.
|
|
108
|
-
*/
|
|
109
|
-
setToSetupPose(): void;
|
|
110
|
-
/**
|
|
111
|
-
* Sets the bones to the setup pose, using the values from the `BoneData` list in the `SkeletonData`.
|
|
112
|
-
*/
|
|
113
|
-
setBonesToSetupPose(): void;
|
|
114
|
-
/**
|
|
115
|
-
* Sets the slots to the setup pose, using the values from the `SlotData` list in the `SkeletonData`.
|
|
116
|
-
*/
|
|
117
|
-
setSlotsToSetupPose(): void;
|
|
118
|
-
/**
|
|
119
|
-
* Finds a bone by name. This does a string comparison for every bone.
|
|
120
|
-
* @param {String} boneName
|
|
121
|
-
* @returns {.spine.Bone}
|
|
122
|
-
*/
|
|
123
|
-
findBone(boneName: string): any;
|
|
124
|
-
/**
|
|
125
|
-
* Finds a slot by name. This does a string comparison for every slot.
|
|
126
|
-
* @param {String} slotName
|
|
127
|
-
* @returns {.spine.Slot}
|
|
128
|
-
*/
|
|
129
|
-
findSlot(slotName: string): any;
|
|
130
|
-
/**
|
|
131
|
-
* Finds a skin by name and makes it the active skin. This does a string comparison for every skin. Note that setting the skin does not change which attachments are visible.
|
|
132
|
-
* @param {string} skinName
|
|
133
|
-
* @returns {.spine.Skin}
|
|
134
|
-
*/
|
|
135
|
-
setSkin(skinName: string): any;
|
|
136
|
-
/**
|
|
137
|
-
* Returns the attachment for the slot and attachment name. The skeleton looks first in its skin, then in the skeleton data’s default skin.
|
|
138
|
-
* @param {String} slotName
|
|
139
|
-
* @param {String} attachmentName
|
|
140
|
-
* @returns {.spine.Attachment}
|
|
141
|
-
*/
|
|
142
|
-
getAttachment(slotName: string, attachmentName: string): any;
|
|
143
|
-
/**
|
|
144
|
-
* Sets the attachment for the slot and attachment name. The skeleton looks first in its skin, then in the skeleton data’s default skin.
|
|
145
|
-
* @param {String} slotName
|
|
146
|
-
* @param {String} attachmentName
|
|
147
|
-
*/
|
|
148
|
-
setAttachment(slotName: string, attachmentName: string): void;
|
|
149
|
-
/**
|
|
150
|
-
* Sets the premultiplied alpha value to Skeleton.
|
|
151
|
-
* @param {Number} alpha
|
|
152
|
-
*/
|
|
153
|
-
setPremultipliedAlpha(premultiplied: boolean): void;
|
|
154
|
-
/**
|
|
155
|
-
* Returns whether to enable premultiplied alpha.
|
|
156
|
-
* @returns {boolean}
|
|
157
|
-
*/
|
|
158
|
-
isPremultipliedAlpha(): boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Sets skeleton data to Skeleton.
|
|
161
|
-
* @param {.spine.SkeletonData} skeletonData
|
|
162
|
-
* @param {.spine.SkeletonData} ownsSkeletonData
|
|
163
|
-
*/
|
|
164
|
-
setSkeletonData(skeletonData: any, ownsSkeletonData: any): void;
|
|
165
|
-
/**
|
|
166
|
-
* Return the renderer of attachment.
|
|
167
|
-
* @param {.spine.RegionAttachment|.spine.BoundingBoxAttachment} regionAttachment
|
|
168
|
-
* @returns {.spine.TextureAtlasRegion}
|
|
169
|
-
*/
|
|
170
|
-
getTextureAtlas(regionAttachment: any): any;
|
|
171
|
-
/**
|
|
172
|
-
* Returns the blendFunc of Skeleton.
|
|
173
|
-
* @returns {cc.BlendFunc}
|
|
174
|
-
*/
|
|
175
|
-
getBlendFunc(): any;
|
|
176
|
-
/**
|
|
177
|
-
* Sets the blendFunc of Skeleton, it won't have any effect for skeleton, skeleton is using slot's data to determine the blend function.
|
|
178
|
-
* @param {cc.BlendFunc|Number} src
|
|
179
|
-
* @param {Number} [dst]
|
|
180
|
-
*/
|
|
181
|
-
setBlendFunc(src: any, dst?: any): any;
|
|
182
|
-
/**
|
|
183
|
-
* Update will be called automatically every frame if "scheduleUpdate" is called when the node is "live".
|
|
184
|
-
* @param {Number} dt Delta time since last update
|
|
185
|
-
*/
|
|
186
|
-
update(dt: number): void;
|
|
187
|
-
static create(skeletonDataFile: string, atlasFile: string, scale?: number): Skeleton;
|
|
188
|
-
}
|
|
189
|
-
//# sourceMappingURL=CCSkeleton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CCSkeleton.d.ts","sourceRoot":"","sources":["../../src/spine/CCSkeleton.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;8EAwB8E;AAE9E;;;;GAIG;AACH;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,EAAE,CAAC,IAAI;IACnC,SAAS,MAAO;IAChB,SAAS,MAAO;IAChB,UAAU,SAAI;IACd,WAAW,UAAQ;IACnB,WAAW,UAAQ;IACnB,mBAAmB,MAAA;IACnB,iBAAiB,MAAO;IACxB,MAAM,MAAO;gBAED,gBAAgB,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAOzE,gBAAgB;IAKhB,OAAO;IAKP,MAAM;IAKN;;;OAGG;IACH,cAAc,CAAC,MAAM,EAAE,OAAO;IAI9B;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,OAAO;IAI7B;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO;IAIrC;;;OAGG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO;IAIrC;;;OAGG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM;IAI1B,YAAY,IAAI,MAAM;IAItB;;;;;OAKG;IACH,YAAY,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAiCxE;;;OAGG;IACH,cAAc;IAkDd;;OAEG;IACH,oBAAoB;IAIpB;;OAEG;IACH,cAAc;IAId;;OAEG;IACH,mBAAmB;IAInB;;OAEG;IACH,mBAAmB;IAInB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAIzB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAIzB;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM;IAIxB;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAItD;;;;OAIG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAItD;;;OAGG;IACH,qBAAqB,CAAC,aAAa,EAAE,OAAO;IAI5C;;;OAGG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;;;OAIG;IACH,eAAe,CAAC,YAAY,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG;IAcxD;;;;OAIG;IACH,eAAe,CAAC,gBAAgB,EAAE,GAAG;IAIrC;;;OAGG;IACH,YAAY,IAAI,GAAG;IAUnB;;;;OAIG;IACH,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG;IAKhC;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM;IAKjB,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CAG1E"}
|