@safe-engine/cocos 1.2.2 → 1.3.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.
Files changed (65) hide show
  1. package/@types/index.d.ts +2 -0
  2. package/@types/safex.d.ts +1 -3
  3. package/dist/dragonbones/PixiDragonBonesSprite.d.ts +9 -0
  4. package/dist/dragonbones/PixiDragonBonesSprite.d.ts.map +1 -0
  5. package/dist/dragonbones/PixiDragonBonesSprite.js +86 -0
  6. package/dist/dragonbones/index.d.ts +30 -16
  7. package/dist/dragonbones/index.d.ts.map +1 -1
  8. package/dist/dragonbones/index.js +73 -54
  9. package/dist/gworld/components/CollideComponent.d.ts.map +1 -1
  10. package/dist/gworld/components/CollideComponent.js +3 -0
  11. package/dist/gworld/components/EnhancedComponent.d.ts +1 -1
  12. package/dist/gworld/components/EnhancedComponent.d.ts.map +1 -1
  13. package/dist/gworld/components/GUIComponent.d.ts +5 -5
  14. package/dist/gworld/components/GUIComponent.d.ts.map +1 -1
  15. package/dist/gworld/components/NoRenderComponent.d.ts +2 -0
  16. package/dist/gworld/components/NoRenderComponent.d.ts.map +1 -1
  17. package/dist/gworld/components/NoRenderComponent.js +7 -0
  18. package/dist/gworld/components/NodeComp.d.ts +34 -66
  19. package/dist/gworld/components/NodeComp.d.ts.map +1 -1
  20. package/dist/gworld/components/NodeComp.js +38 -58
  21. package/dist/gworld/components/RenderComponent.d.ts +4 -4
  22. package/dist/gworld/components/RenderComponent.d.ts.map +1 -1
  23. package/dist/gworld/core/NodePool.d.ts +9 -0
  24. package/dist/gworld/core/NodePool.d.ts.map +1 -0
  25. package/dist/gworld/core/NodePool.js +30 -0
  26. package/dist/gworld/systems/AnimationSystem.d.ts +1 -2
  27. package/dist/gworld/systems/AnimationSystem.d.ts.map +1 -1
  28. package/dist/gworld/systems/AnimationSystem.js +6 -14
  29. package/dist/gworld/systems/CollideSystem.d.ts +3 -2
  30. package/dist/gworld/systems/CollideSystem.d.ts.map +1 -1
  31. package/dist/gworld/systems/CollideSystem.js +20 -32
  32. package/dist/gworld/systems/GUISystem.d.ts +10 -2
  33. package/dist/gworld/systems/GUISystem.d.ts.map +1 -1
  34. package/dist/gworld/systems/GUISystem.js +100 -126
  35. package/dist/gworld/systems/NoRenderSystem.d.ts +11 -2
  36. package/dist/gworld/systems/NoRenderSystem.d.ts.map +1 -1
  37. package/dist/gworld/systems/NoRenderSystem.js +65 -73
  38. package/dist/gworld/systems/RenderSystem.d.ts +9 -2
  39. package/dist/gworld/systems/RenderSystem.d.ts.map +1 -1
  40. package/dist/gworld/systems/RenderSystem.js +76 -97
  41. package/dist/helper/utils.d.ts +1 -2
  42. package/dist/helper/utils.d.ts.map +1 -1
  43. package/dist/helper/utils.js +10 -20
  44. package/dist/index.d.ts +3 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +3 -1
  47. package/dist/polyfills.d.ts +9 -9
  48. package/dist/polyfills.d.ts.map +1 -1
  49. package/dist/polyfills.js +1 -1
  50. package/package.json +2 -3
  51. package/dist/dragonbones/cocos/CocosArmatureDisplay.d.ts +0 -83
  52. package/dist/dragonbones/cocos/CocosArmatureDisplay.d.ts.map +0 -1
  53. package/dist/dragonbones/cocos/CocosArmatureDisplay.js +0 -259
  54. package/dist/dragonbones/cocos/CocosFactory.d.ts +0 -128
  55. package/dist/dragonbones/cocos/CocosFactory.d.ts.map +0 -1
  56. package/dist/dragonbones/cocos/CocosFactory.js +0 -225
  57. package/dist/dragonbones/cocos/CocosSlot.d.ts +0 -49
  58. package/dist/dragonbones/cocos/CocosSlot.d.ts.map +0 -1
  59. package/dist/dragonbones/cocos/CocosSlot.js +0 -385
  60. package/dist/dragonbones/cocos/CocosTextureAtlasData.d.ts +0 -53
  61. package/dist/dragonbones/cocos/CocosTextureAtlasData.d.ts.map +0 -1
  62. package/dist/dragonbones/cocos/CocosTextureAtlasData.js +0 -157
  63. package/dist/dragonbones/dragonBones.d.ts +0 -3
  64. package/dist/dragonbones/dragonBones.d.ts.map +0 -1
  65. package/dist/dragonbones/dragonBones.js +0 -4788
@@ -9,14 +9,15 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
9
9
  children: NodeComp[];
10
10
  name: string;
11
11
  _group: any;
12
+ _active: boolean;
12
13
  constructor(instance: C, entity: Entity);
13
14
  get uuid(): number;
14
- get position(): Vec2;
15
+ get position(): Readonly<Vec2>;
15
16
  set position(val: Vec2);
16
- get x(): number;
17
- set x(val: number);
18
- get y(): number;
19
- set y(val: number);
17
+ getPositionX(): number;
18
+ setPositionX(val: number): void;
19
+ getPositionY(): number;
20
+ setPositionY(val: number): void;
20
21
  get scale(): number;
21
22
  set scale(val: number);
22
23
  get scaleX(): number;
@@ -27,28 +28,12 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
27
28
  set anchorX(val: number);
28
29
  get anchorY(): number;
29
30
  set anchorY(val: number);
30
- /**
31
- * Returns the rotation of the node in radians. 0 is the default rotation angle. Positive values rotate node clockwise.
32
- * @function
33
- * @return {Number} The rotation of the node in radians.
34
- */
35
- get rotation(): number;
36
- /**
37
- *
38
- * Sets the X rotation of the node in radians which performs a horizontal rotational skew.
39
- * (support only in WebGL rendering mode)
40
- * 0 is the default rotation angle.
41
- * Positive values rotate node clockwise, and negative values for anti-clockwise.
42
- *
43
- * @param {Number} radians The X rotation in radians which performs a horizontal rotational skew.
44
- */
45
- set rotation(val: number);
46
31
  /**
47
32
  * Returns the angle of the node in degrees. 0 is the default rotation angle. Positive values rotate node clockwise.
48
33
  * @function
49
34
  * @return {Number} The rotation of the node in degrees.
50
35
  */
51
- get angle(): number;
36
+ get rotation(): number;
52
37
  /**
53
38
  *
54
39
  * Sets the X angle of the node in degrees which performs a horizontal rotational skew.
@@ -58,7 +43,7 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
58
43
  *
59
44
  * @param {Number} degrees The X rotation in degrees which performs a horizontal rotational skew.
60
45
  */
61
- set angle(val: number);
46
+ set rotation(val: number);
62
47
  get color(): cc.Color;
63
48
  set color(val: cc.Color);
64
49
  get opacity(): number;
@@ -87,15 +72,15 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
87
72
  convertToNodeSpace(point: cc.Point): {
88
73
  x: number;
89
74
  y: number;
90
- equals(other: cc.Vec2): boolean;
91
- add(value: cc.Point): cc.Vec2;
92
- addSelf(value: cc.Point): cc.Vec2;
93
- sub(value: cc.Point): cc.Vec2;
94
- mul(multiply: number): cc.Vec2;
95
- mulSelf(multiply: number): cc.Vec2;
75
+ equals(other: /*elided*/ any): boolean;
76
+ add(value: cc.Point | Vec2): /*elided*/ any;
77
+ addSelf(value: cc.Point | Vec2): /*elided*/ any;
78
+ sub(value: cc.Point | Vec2): /*elided*/ any;
79
+ mul(multiply: number): /*elided*/ any;
80
+ mulSelf(multiply: number): /*elided*/ any;
96
81
  mag(): number;
97
- normalizeSelf(): cc.Vec2;
98
- normalize(): cc.Vec2;
82
+ normalizeSelf(): /*elided*/ any;
83
+ normalize(): /*elided*/ any;
99
84
  cross(other: Vec2): number;
100
85
  signAngle(other: Vec2): number;
101
86
  lengthSqr(): number;
@@ -106,15 +91,15 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
106
91
  convertToNodeSpaceAR(point: cc.Point): {
107
92
  x: number;
108
93
  y: number;
109
- equals(other: cc.Vec2): boolean;
110
- add(value: cc.Point): cc.Vec2;
111
- addSelf(value: cc.Point): cc.Vec2;
112
- sub(value: cc.Point): cc.Vec2;
113
- mul(multiply: number): cc.Vec2;
114
- mulSelf(multiply: number): cc.Vec2;
94
+ equals(other: /*elided*/ any): boolean;
95
+ add(value: cc.Point | Vec2): /*elided*/ any;
96
+ addSelf(value: cc.Point | Vec2): /*elided*/ any;
97
+ sub(value: cc.Point | Vec2): /*elided*/ any;
98
+ mul(multiply: number): /*elided*/ any;
99
+ mulSelf(multiply: number): /*elided*/ any;
115
100
  mag(): number;
116
- normalizeSelf(): cc.Vec2;
117
- normalize(): cc.Vec2;
101
+ normalizeSelf(): /*elided*/ any;
102
+ normalize(): /*elided*/ any;
118
103
  cross(other: Vec2): number;
119
104
  signAngle(other: Vec2): number;
120
105
  lengthSqr(): number;
@@ -125,34 +110,15 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
125
110
  convertToWorldSpaceAR(point: cc.Vec2): {
126
111
  x: number;
127
112
  y: number;
128
- equals(other: cc.Vec2): boolean;
129
- add(value: cc.Point): cc.Vec2;
130
- addSelf(value: cc.Point): cc.Vec2;
131
- sub(value: cc.Point): cc.Vec2;
132
- mul(multiply: number): cc.Vec2;
133
- mulSelf(multiply: number): cc.Vec2;
134
- mag(): number;
135
- normalizeSelf(): cc.Vec2;
136
- normalize(): cc.Vec2;
137
- cross(other: Vec2): number;
138
- signAngle(other: Vec2): number;
139
- lengthSqr(): number;
140
- dot(other: Vec2): number;
141
- angle(other: Vec2): number;
142
- distance(other: /*elided*/ any): number;
143
- };
144
- getPosition(): {
145
- x: number;
146
- y: number;
147
- equals(other: cc.Vec2): boolean;
148
- add(value: cc.Point): cc.Vec2;
149
- addSelf(value: cc.Point): cc.Vec2;
150
- sub(value: cc.Point): cc.Vec2;
151
- mul(multiply: number): cc.Vec2;
152
- mulSelf(multiply: number): cc.Vec2;
113
+ equals(other: /*elided*/ any): boolean;
114
+ add(value: cc.Point | Vec2): /*elided*/ any;
115
+ addSelf(value: cc.Point | Vec2): /*elided*/ any;
116
+ sub(value: cc.Point | Vec2): /*elided*/ any;
117
+ mul(multiply: number): /*elided*/ any;
118
+ mulSelf(multiply: number): /*elided*/ any;
153
119
  mag(): number;
154
- normalizeSelf(): cc.Vec2;
155
- normalize(): cc.Vec2;
120
+ normalizeSelf(): /*elided*/ any;
121
+ normalize(): /*elided*/ any;
156
122
  cross(other: Vec2): number;
157
123
  signAngle(other: Vec2): number;
158
124
  lengthSqr(): number;
@@ -160,6 +126,7 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
160
126
  angle(other: Vec2): number;
161
127
  distance(other: /*elided*/ any): number;
162
128
  };
129
+ getPosition(): cc.Point;
163
130
  setPosition(x: number | cc.Vec2 | cc.Vec3 | cc.Point, y?: number): void;
164
131
  setRotation(deg: number): void;
165
132
  getRotation(): number;
@@ -179,6 +146,7 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
179
146
  removeAllChildren(cleanup?: any): void;
180
147
  getData<T>(key: string): T;
181
148
  setData<T extends Integer | Float | string>(key: string, value: T): void;
149
+ removeData(key: string): void;
182
150
  resolveComponent(component: EnhancedComponent<object, NodeComp>): void;
183
151
  }
184
152
  //# sourceMappingURL=NodeComp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeComp.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/NodeComp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIhD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,OAAA,KAAK,IAAI,CAAA;AACjD,qBAAa,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,CAAA;IACX,MAAM,EAAE,QAAQ,CAAA;IAChB,QAAQ,EAAE,QAAQ,EAAE,CAAK;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,MAAA;gBAEM,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM;IAKvC,IAAI,IAAI,WAEP;IAED,IAAI,QAAQ,IAAI,IAAI,CAEnB;IAED,IAAI,QAAQ,CAAC,GAAG,EAAE,IAAI,EAErB;IAED,IAAI,CAAC,IAIM,MAAM,CAFhB;IAED,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,EAEhB;IAED,IAAI,CAAC,IA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MAAM,CAAC,EAAE,MAAM;IAatD,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IAIxB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAIxC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc;IAIhC,cAAc;IAId,0BAA0B;IAK1B,2BAA2B;IAK3B,gBAAgB,CAAC,OAAO,CAAC,EAAE,OAAO;IAiBlC,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAQvD,iBAAiB,CAAC,OAAO,CAAC,KAAA;IAM1B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;IAM1B,OAAO,CAAC,CAAC,SAAS,OAAO,GAAG,KAAK,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAQjE,UAAU,CAAC,GAAG,EAAE,MAAM;IAOtB,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC;CAOhE"}
@@ -11,6 +11,7 @@ var NoRenderComponent_1 = require("./NoRenderComponent");
11
11
  var NodeComp = /** @class */ (function () {
12
12
  function NodeComp(instance, entity) {
13
13
  this.children = [];
14
+ this._active = true;
14
15
  this.entity = entity;
15
16
  this.instance = instance;
16
17
  }
@@ -23,34 +24,26 @@ var NodeComp = /** @class */ (function () {
23
24
  });
24
25
  Object.defineProperty(NodeComp.prototype, "position", {
25
26
  get: function () {
26
- return this.getPosition();
27
+ return (0, polyfills_1.Vec2)(this.instance.getPosition());
27
28
  },
28
29
  set: function (val) {
29
- this.setPosition(val.x, val.y);
30
- },
31
- enumerable: false,
32
- configurable: true
33
- });
34
- Object.defineProperty(NodeComp.prototype, "x", {
35
- get: function () {
36
- return this.instance.getPositionX();
37
- },
38
- set: function (val) {
39
- this.instance.setPositionX(val);
40
- },
41
- enumerable: false,
42
- configurable: true
43
- });
44
- Object.defineProperty(NodeComp.prototype, "y", {
45
- get: function () {
46
- return this.instance.getPositionY();
47
- },
48
- set: function (val) {
49
- this.instance.setPositionY(val);
30
+ this.instance.setPosition(val.x, val.y);
50
31
  },
51
32
  enumerable: false,
52
33
  configurable: true
53
34
  });
35
+ NodeComp.prototype.getPositionX = function () {
36
+ return this.instance.getPositionX();
37
+ };
38
+ NodeComp.prototype.setPositionX = function (val) {
39
+ this.instance.setPositionX(val);
40
+ };
41
+ NodeComp.prototype.getPositionY = function () {
42
+ return this.instance.getPositionY();
43
+ };
44
+ NodeComp.prototype.setPositionY = function (val) {
45
+ this.instance.setPositionY(val);
46
+ };
54
47
  Object.defineProperty(NodeComp.prototype, "scale", {
55
48
  get: function () {
56
49
  return this.instance.getScale();
@@ -102,30 +95,6 @@ var NodeComp = /** @class */ (function () {
102
95
  configurable: true
103
96
  });
104
97
  Object.defineProperty(NodeComp.prototype, "rotation", {
105
- /**
106
- * Returns the rotation of the node in radians. 0 is the default rotation angle. Positive values rotate node clockwise.
107
- * @function
108
- * @return {Number} The rotation of the node in radians.
109
- */
110
- get: function () {
111
- return cc.degreesToRadians(this.instance.getRotation());
112
- },
113
- /**
114
- *
115
- * Sets the X rotation of the node in radians which performs a horizontal rotational skew.
116
- * (support only in WebGL rendering mode)
117
- * 0 is the default rotation angle.
118
- * Positive values rotate node clockwise, and negative values for anti-clockwise.
119
- *
120
- * @param {Number} radians The X rotation in radians which performs a horizontal rotational skew.
121
- */
122
- set: function (val) {
123
- this.instance.setRotation(cc.radiansToDegrees(val));
124
- },
125
- enumerable: false,
126
- configurable: true
127
- });
128
- Object.defineProperty(NodeComp.prototype, "angle", {
129
98
  /**
130
99
  * Returns the angle of the node in degrees. 0 is the default rotation angle. Positive values rotate node clockwise.
131
100
  * @function
@@ -171,12 +140,21 @@ var NodeComp = /** @class */ (function () {
171
140
  });
172
141
  Object.defineProperty(NodeComp.prototype, "active", {
173
142
  get: function () {
174
- return cc.sys.isObjectValid(this.instance) && this.instance.visible;
143
+ if (!cc.sys.isObjectValid(this.instance) || !this._active)
144
+ return false;
145
+ var p = this.parent;
146
+ while (p) {
147
+ if (!p.active)
148
+ return false;
149
+ p = p.parent;
150
+ }
151
+ return true;
175
152
  },
176
153
  set: function (val) {
177
154
  if (!cc.sys.isObjectValid(this.instance)) {
178
155
  return;
179
156
  }
157
+ this._active = val;
180
158
  if (this.instance instanceof ccui.Widget) {
181
159
  this.instance.setEnabled(val);
182
160
  }
@@ -301,17 +279,10 @@ var NodeComp = /** @class */ (function () {
301
279
  return (0, polyfills_1.Vec2)(x, y);
302
280
  };
303
281
  NodeComp.prototype.getPosition = function () {
304
- return (0, polyfills_1.Vec2)(this.x, this.y);
282
+ return this.instance.getPosition();
305
283
  };
306
284
  NodeComp.prototype.setPosition = function (x, y) {
307
- if (typeof x !== 'number') {
308
- this.x = x.x;
309
- this.y = x.y;
310
- }
311
- else {
312
- this.x = x;
313
- this.y = y;
314
- }
285
+ this.instance.setPosition(x, y);
315
286
  };
316
287
  NodeComp.prototype.setRotation = function (deg) {
317
288
  this.instance.setRotation(deg);
@@ -369,6 +340,7 @@ var NodeComp = /** @class */ (function () {
369
340
  };
370
341
  NodeComp.prototype.removeFromParent = function (cleanup) {
371
342
  var _this = this;
343
+ this.active = false;
372
344
  if (this.parent) {
373
345
  (0, remove_1.default)(this.parent.children, function (_a) {
374
346
  var entity = _a.entity;
@@ -384,18 +356,20 @@ var NodeComp = /** @class */ (function () {
384
356
  this.instance.removeFromParent(cleanup);
385
357
  }
386
358
  else {
387
- this.active = false;
388
359
  this.stopAllActions();
389
360
  this.instance.removeFromParent();
390
361
  }
391
362
  };
392
363
  NodeComp.prototype.addChild = function (child) {
364
+ child._active = true;
393
365
  child.parent = this;
394
366
  this.children.push(child);
395
367
  this.instance.addChild(child.instance);
396
368
  };
397
369
  NodeComp.prototype.removeAllChildren = function (cleanup) {
398
- this.instance.removeAllChildren(cleanup);
370
+ this.children.forEach(function (child) {
371
+ child.removeFromParent(cleanup);
372
+ });
399
373
  };
400
374
  NodeComp.prototype.getData = function (key) {
401
375
  var data = this.getComponent(NoRenderComponent_1.ExtraDataComp);
@@ -412,6 +386,12 @@ var NodeComp = /** @class */ (function () {
412
386
  data.setData(key, value);
413
387
  }
414
388
  };
389
+ NodeComp.prototype.removeData = function (key) {
390
+ var data = this.getComponent(NoRenderComponent_1.ExtraDataComp);
391
+ if (data) {
392
+ data.removeData(key);
393
+ }
394
+ };
415
395
  NodeComp.prototype.resolveComponent = function (component) {
416
396
  if (component.constructor.hasRender) {
417
397
  this.addChild(component.node);
@@ -1,4 +1,4 @@
1
- import { GraphicsRenderProps, RefComp, SpineData } from '../../../@types/safex';
1
+ import { BaseComponentProps, GraphicsRenderProps, SpineData } from '../../../@types/safex';
2
2
  import { ComponentX } from '../core/decorator';
3
3
  export declare class NodeRender extends ComponentX {
4
4
  nodeName: string;
@@ -8,7 +8,7 @@ interface SpriteRenderProps {
8
8
  texType?: number;
9
9
  type?: number;
10
10
  }
11
- export declare class SpriteRender extends ComponentX<SpriteRenderProps & RefComp<SpriteRender>, cc.Sprite> {
11
+ export declare class SpriteRender extends ComponentX<SpriteRenderProps & BaseComponentProps<SpriteRender>, cc.Sprite> {
12
12
  get spriteFrame(): string;
13
13
  set spriteFrame(frame: string);
14
14
  }
@@ -31,7 +31,7 @@ interface SpineSkeletonProps {
31
31
  timeScale?: number;
32
32
  loop?: boolean;
33
33
  }
34
- export declare class SpineSkeleton extends ComponentX<SpineSkeletonProps & RefComp<SpineSkeleton>> {
34
+ export declare class SpineSkeleton extends ComponentX<SpineSkeletonProps & BaseComponentProps<SpineSkeleton>> {
35
35
  data: SpineData;
36
36
  skin: string;
37
37
  animation: string;
@@ -40,7 +40,7 @@ export declare class SpineSkeleton extends ComponentX<SpineSkeletonProps & RefCo
40
40
  setAnimation(name: string, loop?: boolean): void;
41
41
  setSkeletonData(data: string): void;
42
42
  }
43
- export declare class GraphicsRender extends ComponentX<GraphicsRenderProps & RefComp<GraphicsRender>, cc.DrawNode> {
43
+ export declare class GraphicsRender extends ComponentX<GraphicsRenderProps & BaseComponentProps<GraphicsRender>, cc.DrawNode> {
44
44
  lineWidth: number;
45
45
  strokeColor: cc.Color;
46
46
  fillColor: cc.Color;
@@ -1 +1 @@
1
- {"version":3,"file":"RenderComponent.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/RenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,qBAAa,UAAW,SAAQ,UAAU;IACxC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,qBAAa,YAAa,SAAQ,UAAU,CAAC,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC;IAChG,IAAI,WAAW,WAEd;IAED,IAAI,WAAW,CAAC,KAAK,QAAA,EAepB;CACF;AACD,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AACD,qBAAa,UAAW,SAAQ,UAAU,CAAC,eAAe,EAAE,EAAE,CAAC,YAAY,CAAC;CAAI;AAEhF,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAA;CAClB;AACD,qBAAa,YAAa,SAAQ,UAAU,CAAC,iBAAiB,EAAE,EAAE,CAAC,cAAc,CAAC;CAAI;AAEtF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CA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I;IACb,WAAW,WAAM;IACjB,SAAS,WAAO;IAEhB,MAAM,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA;IAwDd,KAAK;CAKN;AAED,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,qBAAa,QAAS,SAAQ,UAAU,CAAC,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;CAAE,EAAE,EAAE,CAAC,WAAW,CAAC;CAAI"}
@@ -0,0 +1,9 @@
1
+ import { NodeComp } from "../components/NodeComp";
2
+ export declare class NodePool {
3
+ items: NodeComp[];
4
+ put(node: NodeComp): void;
5
+ get(): NodeComp;
6
+ size(): number;
7
+ clear(): void;
8
+ }
9
+ //# sourceMappingURL=NodePool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodePool.d.ts","sourceRoot":"","sources":["../../../src/gworld/core/NodePool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjD,qBAAa,QAAQ;IACnB,KAAK,EAAE,QAAQ,EAAE,CAAK;IAEtB,GAAG,CAAC,IAAI,EAAE,QAAQ;IAQlB,GAAG,IAAI,QAAQ;IAOf,IAAI;IAIJ,KAAK;CAIN"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodePool = void 0;
4
+ var NodePool = /** @class */ (function () {
5
+ function NodePool() {
6
+ this.items = [];
7
+ }
8
+ NodePool.prototype.put = function (node) {
9
+ if (node) {
10
+ node.removeFromParent();
11
+ node.entity.immortal = true;
12
+ this.items.push(node);
13
+ }
14
+ };
15
+ NodePool.prototype.get = function () {
16
+ var node = this.items.pop();
17
+ node.entity.immortal = false;
18
+ node.active = true;
19
+ return node;
20
+ };
21
+ NodePool.prototype.size = function () {
22
+ return this.items.length;
23
+ };
24
+ NodePool.prototype.clear = function () {
25
+ this.items.forEach(function (node) { return node.destroy(); });
26
+ this.items.length = 0;
27
+ };
28
+ return NodePool;
29
+ }());
30
+ exports.NodePool = NodePool;
@@ -1,7 +1,6 @@
1
- import { EntityManager, EventManager, EventReceive, System } from 'entityx-ts';
1
+ import { EntityManager, EventManager, System } from 'entityx-ts';
2
2
  export declare class AnimationSystem implements System {
3
3
  configure(event_manager: EventManager): void;
4
- receive(type: string, event: EventReceive): void;
5
4
  update(entities: EntityManager, events: EventManager, dt: Float): void;
6
5
  }
7
6
  //# sourceMappingURL=AnimationSystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../src/gworld/systems/AnimationSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAInG,qBAAa,eAAgB,YAAW,MAAM;IAC5C,SAAS,CAAC,aAAa,EAAE,YAAY;IAGrC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY;IAczC,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK;CAUhE"}
1
+ {"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../src/gworld/systems/AnimationSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;AAI5E,qBAAa,eAAgB,YAAW,MAAM;IAC5C,SAAS,CAAC,aAAa,EAAE,YAAY;IAQrC,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK;CAUhE"}
@@ -8,20 +8,12 @@ var AnimationSystem = /** @class */ (function () {
8
8
  function AnimationSystem() {
9
9
  }
10
10
  AnimationSystem.prototype.configure = function (event_manager) {
11
- event_manager.subscribe((0, entityx_ts_1.ComponentAddedEvent)(AnimationComponent_1.AnimationComp), this);
12
- };
13
- AnimationSystem.prototype.receive = function (type, event) {
14
- switch (type) {
15
- case (0, entityx_ts_1.ComponentAddedEvent)(AnimationComponent_1.AnimationComp): {
16
- // cc.log('AnimationComp', event);
17
- var animation = event.entity.getComponent(AnimationComponent_1.AnimationComp);
18
- animation.node = event.entity.getComponent(NodeComp_1.NodeComp);
19
- setTimeout(animation.start.bind(animation), 0);
20
- break;
21
- }
22
- default:
23
- break;
24
- }
11
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, AnimationComponent_1.AnimationComp, function (_a) {
12
+ var entity = _a.entity;
13
+ var animation = entity.getComponent(AnimationComponent_1.AnimationComp);
14
+ animation.node = entity.getComponent(NodeComp_1.NodeComp);
15
+ setTimeout(animation.start.bind(animation), 0);
16
+ });
25
17
  };
26
18
  AnimationSystem.prototype.update = function (entities, events, dt) {
27
19
  var animations = entities.entities_with_components(AnimationComponent_1.AnimationComp);
@@ -1,4 +1,4 @@
1
- import { EntityManager, EventManager, EventReceive, System } from 'entityx-ts';
1
+ import { EntityManager, EventManager, System } from 'entityx-ts';
2
2
  import { Collider, Contract } from '../components/CollideComponent';
3
3
  export declare class CollideSystem implements System {
4
4
  listColliders: Collider[];
@@ -9,7 +9,8 @@ export declare class CollideSystem implements System {
9
9
  enabled: boolean;
10
10
  colliderMatrix: boolean[][];
11
11
  configure(event_manager: EventManager): void;
12
- receive(type: string, event: EventReceive): void;
12
+ private onAddCollider;
13
+ private onRemoveCollider;
13
14
  update(entities: EntityManager, events: EventManager, dt: number): void;
14
15
  addCollider(collider: Collider): void;
15
16
  removeCollider(collider: Collider): void;
@@ -1 +1 @@
1
- {"version":3,"file":"CollideSystem.d.ts","sourceRoot":"","sources":["../../../src/gworld/systems/CollideSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAG1H,OAAO,EAA+B,QAAQ,EAA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,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;IA2GhE,WAAW,CAAC,QAAQ,EAAE,QAAQ;IAS9B,cAAc,CAAC,QAAQ,EAAE,QAAQ;IAIjC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK;IAK3B,eAAe,CAAC,MAAM,UAAO;CAI9B"}
@@ -7,46 +7,34 @@ var CollideComponent_1 = require("../components/CollideComponent");
7
7
  var NodeComp_1 = require("../components/NodeComp");
8
8
  var CollideSystem = /** @class */ (function () {
9
9
  function CollideSystem() {
10
+ var _this = this;
10
11
  this.listColliders = [];
11
12
  this._contracts = [];
12
13
  this.removeColliders = [];
13
14
  this.enabledDebugDraw = false;
14
15
  this.enabled = true;
15
16
  this.colliderMatrix = [[true]];
17
+ this.onAddCollider = function (_a) {
18
+ var entity = _a.entity, component = _a.component;
19
+ var collider = entity.assign(new CollideComponent_1.Collider(component));
20
+ collider.node = entity.getComponent(NodeComp_1.NodeComp);
21
+ collider.props = component.props;
22
+ // collider.props.enable = true
23
+ component.node = entity.getComponent(NodeComp_1.NodeComp);
24
+ _this.addCollider(collider);
25
+ };
26
+ this.onRemoveCollider = function (_a) {
27
+ var entity = _a.entity, component = _a.component;
28
+ _this.removeColliders.push(component.getComponent(CollideComponent_1.Collider));
29
+ };
16
30
  }
17
31
  CollideSystem.prototype.configure = function (event_manager) {
18
- event_manager.subscribe((0, entityx_ts_1.ComponentAddedEvent)(CollideComponent_1.BoxCollider), this);
19
- event_manager.subscribe((0, entityx_ts_1.ComponentAddedEvent)(CollideComponent_1.CircleCollider), this);
20
- event_manager.subscribe((0, entityx_ts_1.ComponentAddedEvent)(CollideComponent_1.PolygonCollider), this);
21
- event_manager.subscribe((0, entityx_ts_1.ComponentRemovedEvent)(CollideComponent_1.BoxCollider), this);
22
- event_manager.subscribe((0, entityx_ts_1.ComponentRemovedEvent)(CollideComponent_1.CircleCollider), this);
23
- event_manager.subscribe((0, entityx_ts_1.ComponentRemovedEvent)(CollideComponent_1.PolygonCollider), this);
24
- };
25
- CollideSystem.prototype.receive = function (type, event) {
26
- var ett = event.entity;
27
- var comp = event.component;
28
- switch (type) {
29
- case (0, entityx_ts_1.ComponentAddedEvent)(CollideComponent_1.BoxCollider):
30
- case (0, entityx_ts_1.ComponentAddedEvent)(CollideComponent_1.CircleCollider):
31
- case (0, entityx_ts_1.ComponentAddedEvent)(CollideComponent_1.PolygonCollider): {
32
- // cc.log(type, event)
33
- var collider = ett.assign(new CollideComponent_1.Collider(comp));
34
- collider.node = ett.getComponent(NodeComp_1.NodeComp);
35
- collider.props = comp.props;
36
- // collider.props.enable = true
37
- comp.node = ett.getComponent(NodeComp_1.NodeComp);
38
- this.addCollider(collider);
39
- break;
40
- }
41
- case (0, entityx_ts_1.ComponentRemovedEvent)(CollideComponent_1.BoxCollider):
42
- case (0, entityx_ts_1.ComponentRemovedEvent)(CollideComponent_1.CircleCollider):
43
- case (0, entityx_ts_1.ComponentRemovedEvent)(CollideComponent_1.PolygonCollider): {
44
- this.removeColliders.push(comp.getComponent(CollideComponent_1.Collider));
45
- break;
46
- }
47
- default:
48
- break;
49
- }
32
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, CollideComponent_1.BoxCollider, this.onAddCollider.bind(this));
33
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, CollideComponent_1.CircleCollider, this.onAddCollider.bind(this));
34
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, CollideComponent_1.PolygonCollider, this.onAddCollider.bind(this));
35
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentRemoved, CollideComponent_1.BoxCollider, this.onRemoveCollider.bind(this));
36
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentRemoved, CollideComponent_1.CircleCollider, this.onRemoveCollider.bind(this));
37
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentRemoved, CollideComponent_1.PolygonCollider, this.onRemoveCollider.bind(this));
50
38
  };
51
39
  CollideSystem.prototype.update = function (entities, events, dt) {
52
40
  var _this = this;
@@ -1,7 +1,15 @@
1
- import { EntityManager, EventManager, EventReceive, System } from 'entityx-ts';
1
+ import { EntityManager, EventManager, System } from 'entityx-ts';
2
2
  export declare class GUISystem implements System {
3
+ defaultFont: string;
3
4
  configure(event_manager: EventManager): void;
4
- receive(type: string, event: EventReceive): void;
5
+ private onAddButtonComp;
6
+ private onAddProgressTimerComp;
7
+ private onAddLabelComp;
8
+ private onAddLabelOutlineComp;
9
+ private onAddLabelShadowComp;
10
+ private onAddRichTextComp;
11
+ private onAddScrollViewComp;
12
+ private onAddBlockInputEventsComp;
5
13
  update(entities: EntityManager, events: EventManager, dt: number): any;
6
14
  }
7
15
  //# sourceMappingURL=GUISystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../../src/gworld/systems/GUISystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAiBnG,qBAAa,SAAU,YAAW,MAAM;IACtC,SAAS,CAAC,aAAa,EAAE,YAAY;IAUrC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY;IA2HzC,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;CAIjE"}
1
+ {"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../../src/gworld/systems/GUISystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAoC,MAAM,EAAE,MAAM,YAAY,CAAA;AAiBlG,qBAAa,SAAU,YAAW,MAAM;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,aAAa,EAAE,YAAY;IAWrC,OAAO,CAAC,eAAe,CAuBtB;IAED,OAAO,CAAC,sBAAsB,CAa7B;IAED,OAAO,CAAC,cAAc,CAMrB;IAED,OAAO,CAAC,qBAAqB,CAM5B;IAED,OAAO,CAAC,oBAAoB,CAM3B;IAED,OAAO,CAAC,iBAAiB,CAQxB;IAED,OAAO,CAAC,mBAAmB,CAU1B;IAED,OAAO,CAAC,yBAAyB,CAOhC;IAED,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;CAIjE"}