@safe-engine/cocos 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/chipmunk/PhysicsComponent.d.ts +1 -1
  2. package/dist/chipmunk/PhysicsComponent.d.ts.map +1 -1
  3. package/dist/chipmunk/PhysicsSystem.d.ts.map +1 -1
  4. package/dist/chipmunk/PhysicsSystem.js +15 -9
  5. package/dist/chipmunk/index.d.ts +2 -2
  6. package/dist/chipmunk/index.d.ts.map +1 -1
  7. package/dist/chipmunk/index.js +3 -2
  8. package/dist/core/Scene.d.ts.map +1 -1
  9. package/dist/core/Scene.js +4 -1
  10. package/dist/render/RenderSystem.d.ts +1 -2
  11. package/dist/render/RenderSystem.d.ts.map +1 -1
  12. package/dist/render/RenderSystem.js +0 -3
  13. package/package.json +2 -2
  14. package/dist/core/index.d.ts +0 -6
  15. package/dist/core/index.d.ts.map +0 -1
  16. package/dist/core/index.js +0 -5
  17. package/dist/dragonbones/PixiDragonBonesSprite.d.ts +0 -19
  18. package/dist/dragonbones/PixiDragonBonesSprite.d.ts.map +0 -1
  19. package/dist/dragonbones/PixiDragonBonesSprite.js +0 -75
  20. package/dist/gworld/EnhancedComponent.d.ts +0 -22
  21. package/dist/gworld/EnhancedComponent.d.ts.map +0 -1
  22. package/dist/gworld/EnhancedComponent.js +0 -44
  23. package/dist/gworld/NodeComp.d.ts +0 -153
  24. package/dist/gworld/NodeComp.d.ts.map +0 -1
  25. package/dist/gworld/NodeComp.js +0 -337
  26. package/dist/gworld/NodePool.d.ts +0 -9
  27. package/dist/gworld/NodePool.d.ts.map +0 -1
  28. package/dist/gworld/NodePool.js +0 -23
  29. package/dist/gworld/Scene.d.ts +0 -5
  30. package/dist/gworld/Scene.d.ts.map +0 -1
  31. package/dist/gworld/Scene.js +0 -14
  32. package/dist/gworld/decorator.d.ts +0 -8
  33. package/dist/gworld/decorator.d.ts.map +0 -1
  34. package/dist/gworld/decorator.js +0 -12
  35. package/dist/gworld/index.d.ts +0 -8
  36. package/dist/gworld/index.d.ts.map +0 -1
  37. package/dist/gworld/index.js +0 -14
  38. package/dist/render/TiledSprite.d.ts +0 -13
  39. package/dist/render/TiledSprite.d.ts.map +0 -1
  40. package/dist/render/TiledSprite.js +0 -69
  41. package/dist/safex.d.ts +0 -10
  42. package/dist/safex.d.ts.map +0 -1
  43. package/dist/safex.js +0 -1
  44. package/dist/spine/CCSkeleton.d.ts +0 -189
  45. package/dist/spine/CCSkeleton.d.ts.map +0 -1
  46. package/dist/spine/CCSkeleton.js +0 -320
  47. package/dist/spine/CCSkeletonAnimation.d.ts +0 -146
  48. package/dist/spine/CCSkeletonAnimation.d.ts.map +0 -1
  49. package/dist/spine/CCSkeletonAnimation.js +0 -311
  50. package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts +0 -2
  51. package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts.map +0 -1
  52. package/dist/spine/CCSkeletonCanvasRenderCmd.js +0 -228
  53. package/dist/spine/CCSkeletonTexture.d.ts +0 -25
  54. package/dist/spine/CCSkeletonTexture.d.ts.map +0 -1
  55. package/dist/spine/CCSkeletonTexture.js +0 -60
  56. package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts +0 -28
  57. package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts.map +0 -1
  58. package/dist/spine/CCSkeletonWebGLRenderCmd.js +0 -277
  59. package/dist/spine/PixiSpineSprite.d.ts +0 -19
  60. package/dist/spine/PixiSpineSprite.d.ts.map +0 -1
  61. package/dist/spine/PixiSpineSprite.js +0 -72
@@ -7,8 +7,8 @@ interface RigidBodyProps {
7
7
  density?: Float;
8
8
  restitution?: Float;
9
9
  friction?: Float;
10
- gravityScale?: Float;
11
10
  isSensor?: boolean;
11
+ isLockRotate?: boolean;
12
12
  tag?: number;
13
13
  onBeginContact?: (other: RigidBody) => void;
14
14
  onEndContact?: (other: RigidBody) => void;
@@ -1 +1 @@
1
-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AE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK;IAKlD,iBAAiB,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK;IAkBtD,QAAQ;CAMT"}
@@ -30,7 +30,7 @@ export class PhysicsSystem {
30
30
  rigidBody = instantiate(RigidBody);
31
31
  entity.assign(rigidBody);
32
32
  }
33
- const { type = StaticBody, gravityScale = 1, density = 1, friction = 0.5, restitution = 0.3, isSensor, tag = 0 } = rigidBody.props;
33
+ const { type = DynamicBody, density = 1, friction = 0.5, restitution = 0.3, isSensor, isLockRotate, tag = 0 } = rigidBody.props;
34
34
  const { width, height, offset = [] } = box.props;
35
35
  const [x = 0, y = 0] = offset;
36
36
  const node = entity.getComponent(NodeComp);
@@ -39,8 +39,9 @@ export class PhysicsSystem {
39
39
  let shape;
40
40
  let body;
41
41
  if (type === DynamicBody) {
42
- body = new cp.Body(density * gravityScale, cp.momentForBox(density, width, height));
42
+ body = new cp.Body(density, isLockRotate ? Infinity : cp.momentForBox(density, width, height));
43
43
  shape = new cp.BoxShape2(body, new cp.BB(-hw + x, -hh + y, hw + x, hh + y));
44
+ body.setPos(node.position);
44
45
  this.space.addShape(shape);
45
46
  this.space.addBody(body);
46
47
  }
@@ -49,6 +50,8 @@ export class PhysicsSystem {
49
50
  body.nodeIdleTime = Infinity;
50
51
  shape = new cp.BoxShape2(body, new cp.BB(-hw + x, -hh + y, hw + x, hh + y));
51
52
  this.space.addStaticShape(shape);
53
+ body.setPos(node.position);
54
+ this.space.reindexStatic();
52
55
  }
53
56
  shape.setElasticity(restitution);
54
57
  shape.setFriction(friction);
@@ -60,7 +63,6 @@ export class PhysicsSystem {
60
63
  body.data = node;
61
64
  shape.group = tag;
62
65
  box.node = node;
63
- body.setPos(node.position);
64
66
  });
65
67
  event_manager.subscribe(EventTypes.ComponentAdded, PhysicsCircleCollider, ({ entity, component }) => {
66
68
  // console.log('ComponentAddedEvent PhysicsCircleCollider', component)
@@ -69,7 +71,7 @@ export class PhysicsSystem {
69
71
  rigidBody = instantiate(RigidBody);
70
72
  entity.assign(rigidBody);
71
73
  }
72
- const { type = StaticBody, gravityScale = 1, density = 1, friction = 0.5, restitution = 0.3, isSensor = false, tag = 0, } = rigidBody.props;
74
+ const { type = DynamicBody, isLockRotate, density = 1, friction = 0.5, restitution = 0.3, isSensor = false, tag = 0, } = rigidBody.props;
73
75
  const node = entity.getComponent(NodeComp);
74
76
  const { radius, offset = [] } = component.props;
75
77
  const [x = 0, y = 0] = offset;
@@ -79,8 +81,9 @@ export class PhysicsSystem {
79
81
  let shape;
80
82
  let body;
81
83
  if (type === DynamicBody) {
82
- body = new cp.Body(density * gravityScale, cp.momentForCircle(density, radius, radius, offVect));
84
+ body = new cp.Body(density, isLockRotate ? Infinity : cp.momentForCircle(density, radius, radius, offVect));
83
85
  shape = new cp.CircleShape(body, radius, offVect);
86
+ body.setPos(node.position);
84
87
  this.space.addShape(shape);
85
88
  this.space.addBody(body);
86
89
  }
@@ -89,6 +92,8 @@ export class PhysicsSystem {
89
92
  body.nodeIdleTime = Infinity;
90
93
  shape = new cp.CircleShape(body, radius, offVect);
91
94
  this.space.addStaticShape(shape);
95
+ body.setPos(node.position);
96
+ this.space.reindexStatic();
92
97
  }
93
98
  shape.setElasticity(restitution);
94
99
  shape.setFriction(friction);
@@ -101,7 +106,6 @@ export class PhysicsSystem {
101
106
  body.data = node;
102
107
  shape.group = tag;
103
108
  component.node = node;
104
- body.setPos(node.position);
105
109
  });
106
110
  event_manager.subscribe(EventTypes.ComponentAdded, PhysicsPolygonCollider, ({ entity, component }) => {
107
111
  // console.log('ComponentAddedEvent PhysicsPolygonCollider', component)
@@ -110,7 +114,7 @@ export class PhysicsSystem {
110
114
  rigidBody = instantiate(RigidBody);
111
115
  entity.assign(rigidBody);
112
116
  }
113
- const { type = StaticBody, gravityScale = 1, density = 1, friction = 0.5, restitution = 0.3, isSensor, tag = 0 } = rigidBody.props;
117
+ const { type = DynamicBody, isLockRotate, density = 1, friction = 0.5, restitution = 0.3, isSensor, tag = 0 } = rigidBody.props;
114
118
  const node = entity.getComponent(NodeComp);
115
119
  const { points, offset = [] } = component.props;
116
120
  const [x = 0, y = 0] = offset;
@@ -127,8 +131,9 @@ export class PhysicsSystem {
127
131
  let shape;
128
132
  let body;
129
133
  if (type === DynamicBody) {
130
- body = new cp.Body(density * gravityScale, cp.momentForPoly(density, fixedPoints, offVect));
134
+ body = new cp.Body(density, isLockRotate ? Infinity : cp.momentForPoly(density, fixedPoints, offVect));
131
135
  shape = new cp.PolyShape(body, fixedPoints, offVect);
136
+ body.setPos(node.position);
132
137
  this.space.addShape(shape);
133
138
  this.space.addBody(body);
134
139
  }
@@ -137,6 +142,8 @@ export class PhysicsSystem {
137
142
  body.nodeIdleTime = Infinity;
138
143
  shape = new cp.PolyShape(body, fixedPoints, offVect);
139
144
  this.space.addStaticShape(shape);
145
+ body.setPos(node.position);
146
+ this.space.reindexStatic();
140
147
  }
141
148
  shape.setElasticity(restitution);
142
149
  shape.setFriction(friction);
@@ -148,7 +155,6 @@ export class PhysicsSystem {
148
155
  body.data = node;
149
156
  shape.group = tag;
150
157
  component.node = node;
151
- body.setPos(node.position);
152
158
  });
153
159
  event_manager.subscribe(EventTypes.ComponentRemoved, RigidBody, ({ component }) => {
154
160
  // console.log('ComponentRemovedEvent RigidBody', component)
@@ -1,8 +1,8 @@
1
- import { GameWorld, Vec2 } from '..';
1
+ import { Vec2 } from '..';
2
2
  export * from './PhysicsComponent';
3
3
  export * from './PhysicsSprite';
4
4
  export * from './PhysicsSystem';
5
- export declare function setupPhysics(world?: GameWorld, isDebugDraw?: boolean, gravity?: {
5
+ export declare function setupPhysics(colliderMatrix?: boolean[][], isDebugDraw?: boolean, gravity?: {
6
6
  x: number;
7
7
  y: number;
8
8
  equals(other: /*elided*/ any): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chipmunk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAGpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAE/B,wBAAgB,YAAY,CAAC,KAAK,YAAqB,EAAE,WAAW,UAAQ,EAAE,OAAO;;;;;;;;;;;;;;;;;;CAAe,QAMnG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chipmunk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,IAAI,EAAE,MAAM,IAAI,CAAA;AAGpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAE/B,wBAAgB,YAAY,CAAC,cAAc,cAAW,EAAE,WAAW,UAAQ,EAAE,OAAO;;;;;;;;;;;;;;;;;;CAAe,QAOlG"}
@@ -3,10 +3,11 @@ import { PhysicsSystem } from './PhysicsSystem';
3
3
  export * from './PhysicsComponent';
4
4
  export * from './PhysicsSprite';
5
5
  export * from './PhysicsSystem';
6
- export function setupPhysics(world = GameWorld.Instance, isDebugDraw = false, gravity = Vec2(0, -98)) {
7
- const physicsSystem = world.addSystemAndUpdate(PhysicsSystem);
6
+ export function setupPhysics(colliderMatrix = [[true]], isDebugDraw = false, gravity = Vec2(0, -98)) {
7
+ const physicsSystem = GameWorld.Instance.addSystemAndUpdate(PhysicsSystem);
8
8
  if (isDebugDraw) {
9
9
  physicsSystem.addDebug();
10
10
  }
11
+ physicsSystem.colliderMatrix = colliderMatrix;
11
12
  physicsSystem.space.gravity = gravity;
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../src/core/Scene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,qBAAa,cAAe,SAAQ,iBAAiB;IACnD,MAAM;CASP"}
1
+ {"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../src/core/Scene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,qBAAa,cAAe,SAAQ,iBAAiB;IACnD,MAAM;CAYP"}
@@ -6,7 +6,10 @@ export class SceneComponent extends EnhancedComponent {
6
6
  const world = GameWorld.Instance;
7
7
  world.entities.reset();
8
8
  const root = world.entities.create();
9
- const node = root.assign(new NodeComp(cc.director.getRunningScene(), root));
9
+ const scene = cc.director.getRunningScene();
10
+ scene.unscheduleAllCallbacks();
11
+ scene.stopAllActions();
12
+ const node = root.assign(new NodeComp(scene, root));
10
13
  const sceneComponent = root.assign(this);
11
14
  sceneComponent.node = node;
12
15
  return sceneComponent;
@@ -1,4 +1,4 @@
1
- import { EntityManager, EventManager, System } from 'entityx-ts';
1
+ import { EventManager, System } from 'entityx-ts';
2
2
  export declare enum SpriteTypes {
3
3
  SIMPLE = 0,
4
4
  SLICED = 1,
@@ -17,6 +17,5 @@ export declare class RenderSystem implements System {
17
17
  private onAddTiledMap;
18
18
  private onAddMotionStreak;
19
19
  private onRemovedNodeComp;
20
- update(entities: EntityManager, events: EventManager, dt: number): any;
21
20
  }
22
21
  //# sourceMappingURL=RenderSystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderSystem.d.ts","sourceRoot":"","sources":["../../src/render/RenderSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAoC,MAAM,EAAE,MAAM,YAAY,CAAA;AAKlG,oBAAY,WAAW;IACrB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,KAAK,IAAA;IACL,MAAM,IAAA;IACN,IAAI,IAAA;IACJ,SAAS,IAAA;CACV;AA4CD,qBAAa,YAAa,YAAW,MAAM;IACzC,SAAS,CAAC,aAAa,EAAE,YAAY;IAWrC,OAAO,CAAC,eAAe,CAKtB;IAED,OAAO,CAAC,iBAAiB,CAgBxB;IAED,OAAO,CAAC,eAAe,CAatB;IAED,OAAO,CAAC,mBAAmB,CAQ1B;IAED,OAAO,CAAC,iBAAiB,CAKxB;IAED,OAAO,CAAC,aAAa,CAKpB;IAED,OAAO,CAAC,iBAAiB,CAUxB;IAED,OAAO,CAAC,iBAAiB,CAKxB;IAED,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;CAIjE"}
1
+ {"version":3,"file":"RenderSystem.d.ts","sourceRoot":"","sources":["../../src/render/RenderSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoC,MAAM,EAAE,MAAM,YAAY,CAAA;AAKnF,oBAAY,WAAW;IACrB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,KAAK,IAAA;IACL,MAAM,IAAA;IACN,IAAI,IAAA;IACJ,SAAS,IAAA;CACV;AA4CD,qBAAa,YAAa,YAAW,MAAM;IACzC,SAAS,CAAC,aAAa,EAAE,YAAY;IAWrC,OAAO,CAAC,eAAe,CAKtB;IAED,OAAO,CAAC,iBAAiB,CAgBxB;IAED,OAAO,CAAC,eAAe,CAatB;IAED,OAAO,CAAC,mBAAmB,CAQ1B;IAED,OAAO,CAAC,iBAAiB,CAKxB;IAED,OAAO,CAAC,aAAa,CAKpB;IAED,OAAO,CAAC,iBAAiB,CAUxB;IAED,OAAO,CAAC,iBAAiB,CAKxB;CAKF"}
@@ -131,7 +131,4 @@ export class RenderSystem {
131
131
  node.instance.removeFromParent(true);
132
132
  }
133
133
  };
134
- update() {
135
- // throw new Error('Method not implemented.');
136
- }
137
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safe-engine/cocos",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "safe-engine with cocos renderer support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "@cocos/dragonbones-js": "^1.0.2",
25
25
  "@esotericsoftware/spine-core": "^4.2.93",
26
26
  "box2d-wasm": "^7.0.0",
27
- "cocos-html5-ts": "^2.1.1",
27
+ "cocos-html5-ts": "^2.1.2",
28
28
  "entityx-ts": "^2.3.1"
29
29
  },
30
30
  "author": "",
@@ -1,6 +0,0 @@
1
- export * from './decorator';
2
- export * from './EnhancedComponent';
3
- export * from './NodeComp';
4
- export * from './NodePool';
5
- export * from './Scene';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}
@@ -1,5 +0,0 @@
1
- export * from './decorator';
2
- export * from './EnhancedComponent';
3
- export * from './NodeComp';
4
- export * from './NodePool';
5
- export * from './Scene';
@@ -1,19 +0,0 @@
1
- import { PixiArmatureDisplay } from 'dragonbones-pixijs';
2
- import { Application } from 'pixi.js';
3
- export declare function loadDragonBonesAssets({ skeleton, atlas, texture }: {
4
- skeleton: any;
5
- atlas: any;
6
- texture: any;
7
- }): Promise<any>;
8
- export declare class PixiDragonBonesSprite extends cc.Sprite {
9
- _canvas: any;
10
- _pixiApp: Application;
11
- _texture: cc.Texture2D;
12
- _config: any;
13
- _armatureDisplay: PixiArmatureDisplay;
14
- constructor(config: any);
15
- _setupArmature(): void;
16
- updateTexture(): void;
17
- onExit(): void;
18
- }
19
- //# sourceMappingURL=PixiDragonBonesSprite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PixiDragonBonesSprite.d.ts","sourceRoot":"","sources":["../../src/dragonbones/PixiDragonBonesSprite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAe,MAAM,oBAAoB,CAAA;AACrE,OAAO,EAAE,WAAW,EAAU,MAAM,SAAS,CAAA;AAE7C,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;;;;CAAA,gBAGjE;AAED,qBAAa,qBAAsB,SAAQ,EAAE,CAAC,MAAM;IAClD,OAAO,EAAE,GAAG,CAAA;IACZ,QAAQ,EAAE,WAAW,CAAA;IACrB,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAA;IACtB,OAAO,MAAA;IACP,gBAAgB,EAAE,mBAAmB,CAAA;gBACzB,MAAM,KAAA;IA+BlB,cAAc;IAuBd,aAAa;IASb,MAAM;CAQP"}
@@ -1,75 +0,0 @@
1
- import { PixiFactory } from 'dragonbones-pixijs';
2
- import { Application, Assets } from 'pixi.js';
3
- export function loadDragonBonesAssets({ skeleton, atlas, texture }) {
4
- // console.log('loadDragonBonesAssets', skeleton, atlas, texture)
5
- return Assets.load([skeleton, atlas, texture]);
6
- }
7
- export class PixiDragonBonesSprite extends cc.Sprite {
8
- _canvas;
9
- _pixiApp;
10
- _texture;
11
- _config;
12
- _armatureDisplay;
13
- constructor(config) {
14
- super();
15
- super.ctor(); // always call this for compatibility with cocos2dx JS Javascript class system
16
- this._canvas = document.createElement('canvas');
17
- this._canvas.width = config.width || 1024;
18
- this._canvas.height = config.height || 1024;
19
- this._pixiApp = new Application();
20
- this._pixiApp.init({
21
- view: this._canvas,
22
- width: this._canvas.width,
23
- height: this._canvas.height,
24
- backgroundAlpha: 0, // nền trong suốt
25
- // transparent: true, // bắt buộc để alpha hoạt động
26
- clearBeforeRender: true, // xoá trước khi vẽ frame mới
27
- preserveDrawingBuffer: true, // giúp lấy ảnh từ canvas
28
- antialias: true,
29
- });
30
- this._texture = new cc.Texture2D();
31
- this._texture.initWithElement(this._canvas);
32
- this._texture.handleLoadedTexture();
33
- this.initWithTexture(this._texture);
34
- this._config = config;
35
- this._armatureDisplay = null;
36
- this._setupArmature();
37
- // this.schedule(this.updateTexture, 1 / 30);
38
- }
39
- _setupArmature() {
40
- const { skeleton, atlas, texture, playTimes, animationName, scale = 1 } = this._config;
41
- const factory = PixiFactory.factory;
42
- const atlasAsset = Assets.get(atlas);
43
- const dragonData = factory.parseDragonBonesData(Assets.get(skeleton), atlasAsset.name);
44
- factory.parseTextureAtlasData(Assets.get(atlas), Assets.get(texture), atlasAsset.name);
45
- const { armatureNames } = dragonData;
46
- const armatureName = armatureNames[0];
47
- const display = factory.buildArmatureDisplay(armatureName, atlasAsset.name);
48
- if (!display) {
49
- console.error('Cannot build armature:', armatureName);
50
- return;
51
- }
52
- display.animation.play(animationName, playTimes);
53
- display.x = this._canvas.width / 2;
54
- display.y = this._canvas.height / 2;
55
- display.scale.set(scale);
56
- this._pixiApp.stage.addChild(display);
57
- this._armatureDisplay = display;
58
- }
59
- updateTexture() {
60
- if (this._armatureDisplay && this._pixiApp.renderer && this._pixiApp.stage) {
61
- this._pixiApp.renderer.render(this._pixiApp.stage);
62
- this._texture.initWithElement(this._canvas);
63
- this._texture.handleLoadedTexture();
64
- this.setTexture(this._texture);
65
- }
66
- }
67
- onExit() {
68
- // this.unschedule(this.updateTexture);
69
- this._pixiApp.destroy(true, { children: true });
70
- this._canvas.remove();
71
- this._armatureDisplay.destroy();
72
- this._armatureDisplay = null;
73
- super.onExit();
74
- }
75
- }
@@ -1,22 +0,0 @@
1
- import { Constructor } from 'entityx-ts';
2
- import { BaseComponentProps } from '../safex';
3
- import { NodeComp } from './NodeComp';
4
- export declare class EnhancedComponent<Props = object, N extends NodeComp<any> = NodeComp<any>> {
5
- static hasRender: boolean;
6
- props: Props;
7
- node: N;
8
- enabled: boolean;
9
- constructor(data?: BaseComponentProps<EnhancedComponent> & Props);
10
- init(data?: Props): void;
11
- addComponent<T extends EnhancedComponent>(instance: T): T;
12
- getComponent<T extends EnhancedComponent>(component: Constructor<T>): T;
13
- schedule(callback: (arg: any) => void, interval: number, repeat?: number, delay?: number): void;
14
- unschedule(callback: (arg: any) => void): void;
15
- unscheduleAllCallbacks(): void;
16
- scheduleOnce(callback: (arg: any) => void, delay: number, key?: string): void;
17
- getComponentsInChildren<T extends ComponentType>(component: Constructor<T>): T[];
18
- getComponentInChildren<T extends ComponentType>(component: Constructor<T>): T;
19
- isEqual(other: EnhancedComponent): boolean;
20
- }
21
- export type ComponentType = EnhancedComponent | NodeComp;
22
- //# sourceMappingURL=EnhancedComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnhancedComponent.d.ts","sourceRoot":"","sources":["../../src/gworld/EnhancedComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,qBAAa,iBAAiB,CAAC,KAAK,GAAG,MAAM,EAAE,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC;IACpF,MAAM,CAAC,SAAS,UAAO;IACvB,KAAK,EAAE,KAAK,CAAY;IACxB,IAAI,EAAE,CAAC,CAAA;IACP,OAAO,UAAO;gBACF,IAAI,CAAC,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,KAAK;IAGhE,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK;IASjB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IAGzD,YAAY,CAAC,CAAC,SAAS,iBAAiB,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAGvE,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAAgC,EAAE,KAAK,SAAI;IAG5G,UAAU,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI;IAGvC,sBAAsB;IAGtB,YAAY,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAGtE,uBAAuB,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;IAGhF,sBAAsB,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAG7E,OAAO,CAAC,KAAK,EAAE,iBAAiB;CAGjC;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,QAAQ,CAAA"}
@@ -1,44 +0,0 @@
1
- export class EnhancedComponent {
2
- static hasRender = true;
3
- props = {};
4
- node;
5
- enabled = true;
6
- constructor(data) {
7
- this.init(data);
8
- }
9
- init(data) {
10
- if (data) {
11
- // console.log('constructor', this.constructor.name, data)
12
- Object.keys(data).forEach((key) => {
13
- this.props[key] = data[key];
14
- });
15
- }
16
- }
17
- addComponent(instance) {
18
- return this.node.addComponent(instance);
19
- }
20
- getComponent(component) {
21
- return this.node.getComponent(component);
22
- }
23
- schedule(callback, interval, repeat = cc.macro.REPEAT_FOREVER, delay = 0) {
24
- this.node.instance.schedule(callback.bind(this), interval, repeat, delay);
25
- }
26
- unschedule(callback) {
27
- this.node.instance.unschedule(callback.bind(this));
28
- }
29
- unscheduleAllCallbacks() {
30
- this.node.instance.unscheduleAllCallbacks();
31
- }
32
- scheduleOnce(callback, delay, key) {
33
- this.node.instance.scheduleOnce(callback, delay, key);
34
- }
35
- getComponentsInChildren(component) {
36
- return this.node.getComponentsInChildren(component);
37
- }
38
- getComponentInChildren(component) {
39
- return this.node.getComponentInChildren(component);
40
- }
41
- isEqual(other) {
42
- return this.node.entity.id === other.node.entity.id;
43
- }
44
- }
@@ -1,153 +0,0 @@
1
- import { Constructor, Entity } from 'entityx-ts';
2
- import { Vec2 } from '../polyfills';
3
- import { ComponentType, EnhancedComponent } from './EnhancedComponent';
4
- export type EventCallbackType = (...args: any[]) => void;
5
- export declare class NodeComp<C extends cc.Node = cc.Node> {
6
- entity: Entity;
7
- instance: C;
8
- parent: NodeComp;
9
- children: NodeComp[];
10
- name: string;
11
- private _group;
12
- private _active;
13
- constructor(instance: C, entity: Entity);
14
- get uuid(): number;
15
- get position(): Readonly<Vec2>;
16
- set position(val: Vec2);
17
- set xy(val: [number, number]);
18
- get posX(): number;
19
- set posX(val: number);
20
- get posY(): number;
21
- set posY(val: number);
22
- get scale(): number;
23
- set scale(val: number);
24
- get scaleX(): number;
25
- set scaleX(val: number);
26
- get scaleY(): number;
27
- set scaleY(val: number);
28
- get anchorX(): number;
29
- set anchorX(val: number);
30
- get anchorY(): number;
31
- set anchorY(val: number);
32
- /**
33
- * Returns the angle of the node in degrees. 0 is the default rotation angle. Positive values rotate node clockwise.
34
- * @function
35
- * @return {Number} The rotation of the node in degrees.
36
- */
37
- get rotation(): number;
38
- /**
39
- *
40
- * Sets the X angle of the node in degrees which performs a horizontal rotational skew.
41
- * (support only in WebGL rendering mode)
42
- * 0 is the default rotation angle.
43
- * Positive values rotate node clockwise, and negative values for anti-clockwise.
44
- *
45
- * @param {Number} degrees The X rotation in degrees which performs a horizontal rotational skew.
46
- */
47
- set rotation(val: number);
48
- get color(): cc.Color;
49
- set color(val: cc.Color);
50
- get opacity(): number;
51
- set opacity(val: number);
52
- get active(): boolean;
53
- set active(val: boolean);
54
- get group(): string | number;
55
- set group(val: string | number);
56
- get width(): number;
57
- set width(val: number);
58
- get height(): number;
59
- set height(val: number);
60
- get zIndex(): number;
61
- set zIndex(val: number);
62
- get childrenCount(): number;
63
- destroy(): void;
64
- addComponent<T extends ComponentType>(instance: T): T;
65
- getComponent<T extends ComponentType>(component: Constructor<T>): T;
66
- getComponentsInChildren<T extends ComponentType>(component: Constructor<T>): T[];
67
- getComponentInChildren<T extends ComponentType>(component: Constructor<T>): T;
68
- hasComponentInChildren<T extends ComponentType>(component: Constructor<T>): boolean;
69
- getPercent(): number;
70
- setPercent(val: number): void;
71
- setTouchEnabled(enabled: boolean): void;
72
- addTouchEventListener(cb: any): void;
73
- convertToNodeSpace(point: cc.Point): {
74
- x: number;
75
- y: number;
76
- equals(other: /*elided*/ any): boolean;
77
- add(value: cc.Point | Vec2): /*elided*/ any;
78
- addSelf(value: cc.Point | Vec2): /*elided*/ any;
79
- sub(value: cc.Point | Vec2): /*elided*/ any;
80
- mul(multiply: number): /*elided*/ any;
81
- mulSelf(multiply: number): /*elided*/ any;
82
- mag(): number;
83
- normalizeSelf(): /*elided*/ any;
84
- normalize(): /*elided*/ any;
85
- cross(other: Vec2): number;
86
- signAngle(other: Vec2): number;
87
- lengthSqr(): number;
88
- dot(other: Vec2): number;
89
- angle(other: Vec2): number;
90
- distance(other: /*elided*/ any): number;
91
- };
92
- convertToNodeSpaceAR(point: cc.Point): {
93
- x: number;
94
- y: number;
95
- equals(other: /*elided*/ any): boolean;
96
- add(value: cc.Point | Vec2): /*elided*/ any;
97
- addSelf(value: cc.Point | Vec2): /*elided*/ any;
98
- sub(value: cc.Point | Vec2): /*elided*/ any;
99
- mul(multiply: number): /*elided*/ any;
100
- mulSelf(multiply: number): /*elided*/ any;
101
- mag(): number;
102
- normalizeSelf(): /*elided*/ any;
103
- normalize(): /*elided*/ any;
104
- cross(other: Vec2): number;
105
- signAngle(other: Vec2): number;
106
- lengthSqr(): number;
107
- dot(other: Vec2): number;
108
- angle(other: Vec2): number;
109
- distance(other: /*elided*/ any): number;
110
- };
111
- convertToWorldSpaceAR(point: cc.Vec2): {
112
- x: number;
113
- y: number;
114
- equals(other: /*elided*/ any): boolean;
115
- add(value: cc.Point | Vec2): /*elided*/ any;
116
- addSelf(value: cc.Point | Vec2): /*elided*/ any;
117
- sub(value: cc.Point | Vec2): /*elided*/ any;
118
- mul(multiply: number): /*elided*/ any;
119
- mulSelf(multiply: number): /*elided*/ any;
120
- mag(): number;
121
- normalizeSelf(): /*elided*/ any;
122
- normalize(): /*elided*/ any;
123
- cross(other: Vec2): number;
124
- signAngle(other: Vec2): number;
125
- lengthSqr(): number;
126
- dot(other: Vec2): number;
127
- angle(other: Vec2): number;
128
- distance(other: /*elided*/ any): number;
129
- };
130
- getPosition(): cc.Point;
131
- setPosition(x: number | cc.Vec2 | cc.Vec3 | cc.Point, y?: number): void;
132
- setRotation(deg: number): void;
133
- getRotation(): number;
134
- setAnchorPoint(point: number | cc.Point, y?: number): void;
135
- getAnchorPoint(): cc.Point;
136
- getBoundingBox(): cc.Rect;
137
- getContentSize(): cc.Size;
138
- setContentSize(size: cc.Size | number, height?: number): void;
139
- setColor(color: cc.Color): void;
140
- setScale(scaleX: number, scaleY?: number): void;
141
- runAction(atc: cc.ActionInterval): void;
142
- stopAllActions(): void;
143
- pauseAllActionsAndSchedule(): void;
144
- resumeAllActionsAndSchedule(): void;
145
- removeFromParent(cleanup?: boolean): void;
146
- addChild(child: NodeComp, zOrder?: number, tag?: number): any;
147
- removeAllChildren(cleanup?: any): void;
148
- getData<T>(key: string): T;
149
- setData<T extends Integer | Float | string>(key: string, value: T): void;
150
- removeData(key: string): void;
151
- resolveComponent(component: EnhancedComponent<object, NodeComp>): void;
152
- }
153
- //# sourceMappingURL=NodeComp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodeComp.d.ts","sourceRoot":"","sources":["../../src/gworld/NodeComp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIhD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEtE,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,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