@safe-engine/cocos 2.2.8 → 2.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 (104) hide show
  1. package/@types/index.d.ts +0 -59
  2. package/dist/app.d.ts +1 -1
  3. package/dist/app.d.ts.map +1 -1
  4. package/dist/app.js +25 -23
  5. package/dist/collider/CollideComponent.d.ts +21 -3
  6. package/dist/collider/CollideComponent.d.ts.map +1 -1
  7. package/dist/core/NodeComp.d.ts +1 -1
  8. package/dist/core/NodeComp.d.ts.map +1 -1
  9. package/dist/dragonbones/DragonBonesComp.d.ts +4 -6
  10. package/dist/dragonbones/DragonBonesComp.d.ts.map +1 -1
  11. package/dist/dragonbones/DragonBonesComp.js +15 -13
  12. package/dist/dragonbones/DragonBonesSystem.d.ts +1 -1
  13. package/dist/dragonbones/DragonBonesSystem.d.ts.map +1 -1
  14. package/dist/dragonbones/DragonBonesSystem.js +42 -35
  15. package/dist/dragonbones/db-cocos/CocosArmatureDisplay.d.ts +87 -0
  16. package/dist/dragonbones/db-cocos/CocosArmatureDisplay.d.ts.map +1 -0
  17. package/dist/dragonbones/db-cocos/CocosArmatureDisplay.js +240 -0
  18. package/dist/dragonbones/db-cocos/CocosFactory.d.ts +128 -0
  19. package/dist/dragonbones/db-cocos/CocosFactory.d.ts.map +1 -0
  20. package/dist/dragonbones/db-cocos/CocosFactory.js +190 -0
  21. package/dist/dragonbones/db-cocos/CocosSlot.d.ts +49 -0
  22. package/dist/dragonbones/db-cocos/CocosSlot.d.ts.map +1 -0
  23. package/dist/dragonbones/db-cocos/CocosSlot.js +368 -0
  24. package/dist/dragonbones/db-cocos/CocosTextureAtlasData.d.ts +53 -0
  25. package/dist/dragonbones/db-cocos/CocosTextureAtlasData.d.ts.map +1 -0
  26. package/dist/dragonbones/db-cocos/CocosTextureAtlasData.js +121 -0
  27. package/dist/dragonbones/index.d.ts +0 -1
  28. package/dist/dragonbones/index.d.ts.map +1 -1
  29. package/dist/dragonbones/index.js +0 -1
  30. package/dist/polyfills.d.ts +1 -1
  31. package/dist/polyfills.d.ts.map +1 -1
  32. package/dist/polyfills.js +1 -2
  33. package/dist/render/RenderComponent.d.ts.map +1 -1
  34. package/dist/render/RenderComponent.js +1 -0
  35. package/dist/render/RenderSystem.d.ts.map +1 -1
  36. package/dist/render/RenderSystem.js +34 -2
  37. package/dist/richtext/RichTextComp.js +1 -1
  38. package/dist/spine/SpineSkeleton.d.ts +5 -3
  39. package/dist/spine/SpineSkeleton.d.ts.map +1 -1
  40. package/dist/spine/SpineSkeleton.js +12 -5
  41. package/dist/spine/SpineSystem.d.ts +1 -2
  42. package/dist/spine/SpineSystem.d.ts.map +1 -1
  43. package/dist/spine/SpineSystem.js +22 -24
  44. package/dist/spine/index.d.ts +0 -1
  45. package/dist/spine/index.d.ts.map +1 -1
  46. package/dist/spine/index.js +14 -2
  47. package/dist/spine/spine-cocos/CCSkeleton.d.ts +86 -0
  48. package/dist/spine/spine-cocos/CCSkeleton.d.ts.map +1 -0
  49. package/dist/spine/{CCSkeleton.js → spine-cocos/CCSkeleton.js} +39 -128
  50. package/dist/spine/spine-cocos/CCSkeletonAnimation.d.ts +87 -0
  51. package/dist/spine/spine-cocos/CCSkeletonAnimation.d.ts.map +1 -0
  52. package/dist/spine/{CCSkeletonAnimation.js → spine-cocos/CCSkeletonAnimation.js} +37 -97
  53. package/dist/spine/spine-cocos/CCSkeletonCanvasRenderCmd.d.ts +28 -0
  54. package/dist/spine/spine-cocos/CCSkeletonCanvasRenderCmd.d.ts.map +1 -0
  55. package/dist/spine/spine-cocos/CCSkeletonCanvasRenderCmd.js +224 -0
  56. package/dist/spine/{CCSkeletonTexture.d.ts → spine-cocos/CCSkeletonTexture.d.ts} +1 -1
  57. package/dist/spine/spine-cocos/CCSkeletonTexture.d.ts.map +1 -0
  58. package/dist/spine/{CCSkeletonTexture.js → spine-cocos/CCSkeletonTexture.js} +5 -5
  59. package/dist/spine/spine-cocos/CCSkeletonWebGLRenderCmd.d.ts.map +1 -0
  60. package/dist/spine/{CCSkeletonWebGLRenderCmd.js → spine-cocos/CCSkeletonWebGLRenderCmd.js} +13 -13
  61. package/package.json +5 -6
  62. package/dist/core/index.d.ts +0 -6
  63. package/dist/core/index.d.ts.map +0 -1
  64. package/dist/core/index.js +0 -5
  65. package/dist/dragonbones/PixiDragonBonesSprite.d.ts +0 -19
  66. package/dist/dragonbones/PixiDragonBonesSprite.d.ts.map +0 -1
  67. package/dist/dragonbones/PixiDragonBonesSprite.js +0 -75
  68. package/dist/gworld/EnhancedComponent.d.ts +0 -22
  69. package/dist/gworld/EnhancedComponent.d.ts.map +0 -1
  70. package/dist/gworld/EnhancedComponent.js +0 -44
  71. package/dist/gworld/NodeComp.d.ts +0 -153
  72. package/dist/gworld/NodeComp.d.ts.map +0 -1
  73. package/dist/gworld/NodeComp.js +0 -337
  74. package/dist/gworld/NodePool.d.ts +0 -9
  75. package/dist/gworld/NodePool.d.ts.map +0 -1
  76. package/dist/gworld/NodePool.js +0 -23
  77. package/dist/gworld/Scene.d.ts +0 -5
  78. package/dist/gworld/Scene.d.ts.map +0 -1
  79. package/dist/gworld/Scene.js +0 -14
  80. package/dist/gworld/decorator.d.ts +0 -8
  81. package/dist/gworld/decorator.d.ts.map +0 -1
  82. package/dist/gworld/decorator.js +0 -12
  83. package/dist/gworld/index.d.ts +0 -8
  84. package/dist/gworld/index.d.ts.map +0 -1
  85. package/dist/gworld/index.js +0 -14
  86. package/dist/render/TiledSprite.d.ts +0 -13
  87. package/dist/render/TiledSprite.d.ts.map +0 -1
  88. package/dist/render/TiledSprite.js +0 -69
  89. package/dist/safex.d.ts +0 -10
  90. package/dist/safex.d.ts.map +0 -1
  91. package/dist/safex.js +0 -1
  92. package/dist/spine/CCSkeleton.d.ts +0 -189
  93. package/dist/spine/CCSkeleton.d.ts.map +0 -1
  94. package/dist/spine/CCSkeletonAnimation.d.ts +0 -146
  95. package/dist/spine/CCSkeletonAnimation.d.ts.map +0 -1
  96. package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts +0 -2
  97. package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts.map +0 -1
  98. package/dist/spine/CCSkeletonCanvasRenderCmd.js +0 -228
  99. package/dist/spine/CCSkeletonTexture.d.ts.map +0 -1
  100. package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts.map +0 -1
  101. package/dist/spine/PixiSpineSprite.d.ts +0 -19
  102. package/dist/spine/PixiSpineSprite.d.ts.map +0 -1
  103. package/dist/spine/PixiSpineSprite.js +0 -72
  104. /package/dist/spine/{CCSkeletonWebGLRenderCmd.d.ts → spine-cocos/CCSkeletonWebGLRenderCmd.d.ts} +0 -0
@@ -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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C;;;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"}
@@ -1,146 +0,0 @@
1
- import { Skeleton } from './CCSkeleton';
2
- /****************************************************************************
3
- Copyright (c) 2011-2012 cocos2d-x.org
4
- Copyright (c) 2013-2014 Chukong Technologies Inc.
5
- Copyright (c) 2014 Shengxiang Chen (Nero Chan)
6
-
7
- http://www.cocos2d-x.org
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy
10
- of this software and associated documentation files (the "Software"), to deal
11
- in the Software without restriction, including without limitation the rights
12
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- copies of the Software, and to permit persons to whom the Software is
14
- furnished to do so, subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in
17
- all copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
- THE SOFTWARE.
26
- ****************************************************************************/
27
- export declare const _atlasLoader: {
28
- spAtlasFile: any;
29
- setAtlasFile: (spAtlasFile: any) => void;
30
- load: (line: any) => any;
31
- unload: () => void;
32
- };
33
- /**
34
- * The skeleton animation of spine. It updates animation's state and skeleton's world transform.
35
- * @class
36
- * @extends Skeleton
37
- */
38
- export declare class SkeletonAnimation extends Skeleton {
39
- _state: any;
40
- _ownsAnimationStateData: boolean;
41
- _listener: any;
42
- constructor(skeletonDataFile?: any, atlasFile?: any, scale?: number);
43
- /**
44
- * Sets animation state data to SkeletonAnimation.
45
- * @param {spine.AnimationStateData} stateData
46
- */
47
- setAnimationStateData(stateData: any): void;
48
- /**
49
- * Mix applies all keyframe values, interpolated for the specified time and mixed with the current values.
50
- * @param {String} fromAnimation
51
- * @param {String} toAnimation
52
- * @param {Number} duration
53
- */
54
- setMix(fromAnimation: string, toAnimation: string, duration: number): void;
55
- /**
56
- * Sets event listener of SkeletonAnimation.
57
- * @param {Object} target
58
- * @param {Function} callback
59
- */
60
- setAnimationListener(target: any, callback: any): void;
61
- /**
62
- * Set the current animation. Any queued animations are cleared.
63
- * @param {Number} trackIndex
64
- * @param {String} name
65
- * @param {Boolean} loop
66
- * @returns {spine.TrackEntry|null}
67
- */
68
- setAnimation(trackIndex: number, name: string, loop: boolean): any;
69
- /**
70
- * Adds an animation to be played delay seconds after the current or last queued animation.
71
- * @param {Number} trackIndex
72
- * @param {String} name
73
- * @param {Boolean} loop
74
- * @param {Number} [delay=0]
75
- * @returns {spine.TrackEntry|null}
76
- */
77
- addAnimation(trackIndex: number, name: string, loop: boolean, delay?: number): any;
78
- /**
79
- * Find animation with specified name
80
- * @param {String} name
81
- * @returns {spine.Animation|null}
82
- */
83
- findAnimation(name: string): any;
84
- /**
85
- * Returns track entry by trackIndex.
86
- * @param trackIndex
87
- * @returns {spine.TrackEntry|null}
88
- */
89
- getCurrent(trackIndex: number): any;
90
- /**
91
- * Clears all tracks of animation state.
92
- */
93
- clearTracks(): void;
94
- /**
95
- * Clears track of animation state by trackIndex.
96
- * @param {Number} trackIndex
97
- */
98
- clearTrack(trackIndex: number): void;
99
- /**
100
- * Update will be called automatically every frame if "scheduleUpdate" is called when the node is "live".
101
- * It updates animation's state and skeleton's world transform.
102
- * @param {Number} dt Delta time since last update
103
- * @override
104
- */
105
- update(dt: number): void;
106
- /**
107
- * Set the start event listener.
108
- * @param {function} listener
109
- */
110
- setStartListener(listener: any): void;
111
- /**
112
- * Set the interrupt listener
113
- * @param {function} listener
114
- */
115
- setInterruptListener(listener: any): void;
116
- /**
117
- * Set the end event listener.
118
- * @param {function} listener
119
- */
120
- setEndListener(listener: any): void;
121
- /**
122
- * Set the dispose listener
123
- * @param {function} listener
124
- */
125
- setDisposeListener(listener: any): void;
126
- setCompleteListener(listener: any): void;
127
- setEventListener(listener: any): void;
128
- setTrackStartListener(entry: any, listener: any): void;
129
- setTrackInterruptListener(entry: any, listener: any): void;
130
- setTrackEndListener(entry: any, listener: any): void;
131
- setTrackDisposeListener(entry: any, listener: any): void;
132
- setTrackCompleteListener(entry: any, listener: any): void;
133
- setTrackEventListener(entry: any, listener: any): void;
134
- getState(): any;
135
- /**
136
- * Creates a skeleton animation object.
137
- * @deprecated since v3.0, please use new SkeletonAnimation(skeletonDataFile, atlasFile, scale) instead.
138
- * @param {spine.SkeletonData|String} skeletonDataFile
139
- * @param {String|spine.Atlas|spine.SkeletonData} atlasFile atlas filename or atlas data or owns SkeletonData
140
- * @param {Number} [scale]
141
- * @returns {SkeletonAnimation}
142
- */
143
- static createWithJsonFile(skeletonDataFile: any, atlasFile: any, scale?: number): SkeletonAnimation;
144
- static create(skeletonDataFile: any, atlasFile: any, scale?: number): SkeletonAnimation;
145
- }
146
- //# sourceMappingURL=CCSkeletonAnimation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CCSkeletonAnimation.d.ts","sourceRoot":"","sources":["../../src/spine/CCSkeletonAnimation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;8EAwB8E;AAE9E,eAAO,MAAM,YAAY;;;;;CAaxB,C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I9B,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAI/C,yBAAyB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAInD,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAI7C,uBAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAIjD,wBAAwB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAIlD,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAI/C,QAAQ;IAIR;;;;;;;OAOG;IACH,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM;IAI/E,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM;CAGpE"}
@@ -1,2 +0,0 @@
1
- export declare const CanvasRenderCmd: any;
2
- //# sourceMappingURL=CCSkeletonCanvasRenderCmd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CCSkeletonCanvasRenderCmd.d.ts","sourceRoot":"","sources":["../../src/spine/CCSkeletonCanvasRenderCmd.ts"],"names":[],"mappings":"AA2PA,eAAO,MAAM,eAAe,KAAyB,CAAA"}
@@ -1,228 +0,0 @@
1
- import * as spine from '@esotericsoftware/spine-core';
2
- /****************************************************************************
3
- Copyright (c) 2013-2014 Chukong Technologies Inc.
4
-
5
- http://www.cocos2d-x.org
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in
15
- all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- THE SOFTWARE.
24
- ****************************************************************************/
25
- var gworld = gworld || {};
26
- (function () {
27
- gworld.CanvasRenderCmd = function (renderableObject) {
28
- this._rootCtor(renderableObject);
29
- this._needDraw = true;
30
- };
31
- const proto = (gworld.CanvasRenderCmd.prototype = Object.create(cc.Node.CanvasRenderCmd.prototype));
32
- proto.constructor = gworld.CanvasRenderCmd;
33
- proto.rendering = function (wrapper, scaleX, scaleY) {
34
- const node = this._node;
35
- let i, n, slot, slotNode;
36
- wrapper = wrapper || cc._renderContext;
37
- const locSkeleton = node._skeleton, drawOrder = locSkeleton.drawOrder;
38
- for (i = 0, n = drawOrder.length; i < n; i++) {
39
- slot = drawOrder[i];
40
- slotNode = slot._slotNode;
41
- if (slotNode._visible && slotNode._renderCmd && slot.currentSprite) {
42
- slotNode._renderCmd.transform(this, true);
43
- slot.currentSprite._renderCmd.rendering(wrapper, scaleX, scaleY);
44
- slotNode._renderCmd._dirtyFlag = slot.currentSprite._renderCmd._dirtyFlag = 0;
45
- }
46
- }
47
- if (!node._debugSlots && !node._debugBones)
48
- return;
49
- wrapper.setTransform(this._worldTransform, scaleX, scaleY);
50
- wrapper.setGlobalAlpha(1);
51
- let attachment;
52
- const drawingUtil = cc._drawingUtil;
53
- if (node._debugSlots) {
54
- // Slots.
55
- drawingUtil.setDrawColor(0, 0, 255, 255);
56
- drawingUtil.setLineWidth(1);
57
- const points = [];
58
- for (i = 0, n = locSkeleton.slots.length; i < n; i++) {
59
- slot = locSkeleton.drawOrder[i];
60
- if (!slot.attachment || !(slot.attachment instanceof spine.RegionAttachment))
61
- continue;
62
- attachment = slot.attachment;
63
- this._updateRegionAttachmentSlot(attachment, slot, points);
64
- drawingUtil.drawPoly(points, 4, true);
65
- }
66
- }
67
- if (node._debugBones) {
68
- // Bone lengths.
69
- let bone;
70
- drawingUtil.setLineWidth(2);
71
- drawingUtil.setDrawColor(255, 0, 0, 255);
72
- for (i = 0, n = locSkeleton.bones.length; i < n; i++) {
73
- bone = locSkeleton.bones[i];
74
- const x = bone.data.length * bone.a + bone.worldX;
75
- const y = bone.data.length * bone.c + bone.worldY;
76
- drawingUtil.drawLine({ x: bone.worldX, y: bone.worldY }, { x: x, y: y });
77
- }
78
- // Bone origins.
79
- const pointSize = 4;
80
- drawingUtil.setDrawColor(0, 0, 255, 255); // Root bone is blue.
81
- for (i = 0, n = locSkeleton.bones.length; i < n; i++) {
82
- bone = locSkeleton.bones[i];
83
- drawingUtil.drawPoint({ x: bone.worldX, y: bone.worldY }, pointSize);
84
- if (i === 0)
85
- drawingUtil.setDrawColor(0, 255, 0, 255);
86
- }
87
- }
88
- };
89
- proto.updateStatus = function () {
90
- this.originUpdateStatus();
91
- this._updateCurrentRegions();
92
- this._regionFlag = cc.Node.CanvasRenderCmd.RegionStatus.DirtyDouble;
93
- this._dirtyFlag &= ~cc.Node._dirtyFlags.contentDirty;
94
- };
95
- proto.getLocalBB = function () {
96
- return this._node.getBoundingBox();
97
- };
98
- proto._updateRegionAttachmentSlot = function (attachment, slot, points) {
99
- if (!points)
100
- return;
101
- const vertices = spine.Utils.setArraySize([], 8, 0);
102
- attachment.computeWorldVertices(slot, vertices, 0, 2);
103
- const VERTEX = spine.RegionAttachment;
104
- points.length = 0;
105
- points.push(cc.p(vertices[VERTEX.X1], vertices[VERTEX.Y1]));
106
- points.push(cc.p(vertices[VERTEX.X4], vertices[VERTEX.Y4]));
107
- points.push(cc.p(vertices[VERTEX.X3], vertices[VERTEX.Y3]));
108
- points.push(cc.p(vertices[VERTEX.X2], vertices[VERTEX.Y2]));
109
- };
110
- proto._createChildFormSkeletonData = function () {
111
- const node = this._node;
112
- const locSkeleton = node._skeleton;
113
- let spriteName, sprite;
114
- for (let i = 0, n = locSkeleton.slots.length; i < n; i++) {
115
- const slot = locSkeleton.slots[i], attachment = slot.attachment;
116
- const slotNode = new cc.Node();
117
- slot._slotNode = slotNode;
118
- if (attachment instanceof spine.RegionAttachment) {
119
- spriteName = attachment.name;
120
- sprite = this._createSprite(slot, attachment);
121
- slot.currentSprite = sprite;
122
- slot.currentSpriteName = spriteName;
123
- slotNode.addChild(sprite);
124
- }
125
- else if (attachment instanceof spine.MeshAttachment) {
126
- //todo for mesh
127
- }
128
- }
129
- };
130
- const loaded = function (sprite, texture, attachment) {
131
- const rendererObject = attachment.region;
132
- const rect = new cc.Rect(rendererObject.x, rendererObject.y, rendererObject.width, rendererObject.height);
133
- sprite.initWithTexture(texture, rect, rendererObject.rotate, false);
134
- sprite._rect.width = attachment.width;
135
- sprite._rect.height = attachment.height;
136
- sprite.setContentSize(attachment.width, attachment.height);
137
- sprite.setRotation(-attachment.rotation);
138
- sprite.setScale((rendererObject.width / rendererObject.originalWidth) * attachment.scaleX, (rendererObject.height / rendererObject.originalHeight) * attachment.scaleY);
139
- };
140
- proto._createSprite = function (slot, attachment) {
141
- const rendererObject = attachment.region;
142
- const texture = rendererObject.texture.getRealTexture();
143
- const sprite = new cc.Sprite();
144
- if (texture.isLoaded()) {
145
- loaded(sprite, texture, attachment);
146
- }
147
- else {
148
- texture.addEventListener('load', function () {
149
- loaded(sprite, texture, attachment);
150
- }, this);
151
- }
152
- slot.sprites = slot.sprites || {};
153
- slot.sprites[rendererObject.name] = sprite;
154
- return sprite;
155
- };
156
- proto._updateChild = function () {
157
- const locSkeleton = this._node._skeleton, slots = locSkeleton.slots;
158
- const color = this._displayedColor, opacity = this._displayedOpacity;
159
- let i, n, selSprite, ax, ay;
160
- let slot, attachment, slotNode;
161
- for (i = 0, n = slots.length; i < n; i++) {
162
- slot = slots[i];
163
- attachment = slot.attachment;
164
- slotNode = slot._slotNode;
165
- if (!attachment) {
166
- slotNode.setVisible(false);
167
- continue;
168
- }
169
- if (attachment instanceof spine.RegionAttachment) {
170
- if (attachment.region) {
171
- if (!slot.currentSpriteName || slot.currentSpriteName !== attachment.name) {
172
- const spriteName = attachment.name;
173
- if (slot.currentSprite !== undefined)
174
- slot.currentSprite.setVisible(false);
175
- slot.sprites = slot.sprites || {};
176
- if (slot.sprites[spriteName] !== undefined)
177
- slot.sprites[spriteName].setVisible(true);
178
- else {
179
- const sprite = this._createSprite(slot, attachment);
180
- slotNode.addChild(sprite);
181
- }
182
- slot.currentSprite = slot.sprites[spriteName];
183
- slot.currentSpriteName = spriteName;
184
- }
185
- }
186
- const bone = slot.bone;
187
- if (attachment.region.offsetX === 0 && attachment.region.offsetY === 0) {
188
- ax = attachment.x;
189
- ay = attachment.y;
190
- }
191
- else {
192
- //var regionScaleX = attachment.width / attachment.regionOriginalWidth * attachment.scaleX;
193
- //ax = attachment.x + attachment.regionOffsetX * regionScaleX - (attachment.width * attachment.scaleX - attachment.regionWidth * regionScaleX) / 2;
194
- ax = (attachment.offset[0] + attachment.offset[4]) * 0.5;
195
- ay = (attachment.offset[1] + attachment.offset[5]) * 0.5;
196
- }
197
- slotNode.setPosition(bone.worldX + ax * bone.a + ay * bone.b, bone.worldY + ax * bone.c + ay * bone.d);
198
- slotNode.setScale(bone.getWorldScaleX(), bone.getWorldScaleY());
199
- //set the color and opacity
200
- selSprite = slot.currentSprite;
201
- selSprite._flippedX = bone.skeleton.flipX;
202
- selSprite._flippedY = bone.skeleton.flipY;
203
- if (selSprite._flippedY || selSprite._flippedX) {
204
- slotNode.setRotation(bone.getWorldRotationX());
205
- selSprite.setRotation(attachment.rotation);
206
- }
207
- else {
208
- slotNode.setRotation(-bone.getWorldRotationX());
209
- selSprite.setRotation(-attachment.rotation);
210
- }
211
- //hack for sprite
212
- selSprite._renderCmd._displayedOpacity = 0 | (opacity * slot.color.a);
213
- const r = 0 | (color.r * slot.color.r), g = 0 | (color.g * slot.color.g), b = 0 | (color.b * slot.color.b);
214
- selSprite.setColor(cc.color(r, g, b));
215
- selSprite._renderCmd._updateColor();
216
- }
217
- else if (attachment instanceof spine.MeshAttachment) {
218
- // Can not render mesh
219
- }
220
- else {
221
- slotNode.setVisible(false);
222
- continue;
223
- }
224
- slotNode.setVisible(true);
225
- }
226
- };
227
- })();
228
- export const CanvasRenderCmd = gworld.CanvasRenderCmd;
@@ -1 +0,0 @@
1
- {"version":3,"file":"CCSkeletonTexture.d.ts","sourceRoot":"","sources":["../../src/spine/CCSkeletonTexture.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;8EAsB8E;AAE9E,eAAO,MAAM,eAAe,GAAa,UAAK,SAE7C,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CCSkeletonWebGLRenderCmd.d.ts","sourceRoot":"","sources":["../../src/spine/CCSkeletonWebGLRenderCmd.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;8EAsB8E;AAE9E,eAAO,MAAM,cAAc;;;CAS1B,CAAA"}
@@ -1,19 +0,0 @@
1
- import { Spine } from '@esotericsoftware/spine-pixi-v8';
2
- import { Application } from 'pixi.js';
3
- export declare function loadSpineAssets({ skeleton, atlas, texture }: {
4
- skeleton: any;
5
- atlas: any;
6
- texture: any;
7
- }): Promise<any>;
8
- export declare class PixiSpineSprite extends cc.Sprite {
9
- _canvas: any;
10
- _pixiApp: Application;
11
- _texture: cc.Texture2D;
12
- _config: any;
13
- _armatureDisplay: Spine;
14
- constructor(config: any);
15
- _setupSpine(): void;
16
- updateTexture(): void;
17
- onExit(): void;
18
- }
19
- //# sourceMappingURL=PixiSpineSprite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PixiSpineSprite.d.ts","sourceRoot":"","sources":["../../src/spine/PixiSpineSprite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AACvD,OAAO,EAAE,WAAW,EAAU,MAAM,SAAS,CAAA;AAE7C,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;;;;CAAA,gBAE3D;AAED,qBAAa,eAAgB,SAAQ,EAAE,CAAC,MAAM;IAC5C,OAAO,EAAE,GAAG,CAAA;IACZ,QAAQ,EAAE,WAAW,CAAA;IACrB,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAA;IACtB,OAAO,MAAA;IACP,gBAAgB,EAAE,KAAK,CAAA;gBACX,MAAM,KAAA;IA4BlB,WAAW;IAsBX,aAAa;IAUb,MAAM;CAMP"}