@safe-engine/cocos 2.6.4 → 2.6.5

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 (82) hide show
  1. package/dist/dragonbones/DragonBonesSystem.js +3 -3
  2. package/dist/dragonbones/PixiDragonBonesSprite.d.ts +18 -8
  3. package/dist/dragonbones/PixiDragonBonesSprite.d.ts.map +1 -1
  4. package/dist/dragonbones/PixiDragonBonesSprite.js +41 -48
  5. package/dist/dragonbones/db-cocos/CocosFactory.d.ts.map +1 -1
  6. package/dist/dragonbones/db-cocos/CocosFactory.js +2 -1
  7. package/dist/dragonbones/db-cocos/SimpleMeshNode.d.ts +1 -1
  8. package/dist/dragonbones/db-cocos/SimpleMeshNode.d.ts.map +1 -1
  9. package/dist/dragonbones/db-cocos/SimpleMeshNode.js +1 -1
  10. package/dist/gui/GUISystem.js +1 -1
  11. package/dist/gworld/components/AnimationComponent.d.ts +65 -0
  12. package/dist/gworld/components/AnimationComponent.d.ts.map +1 -0
  13. package/dist/gworld/components/AnimationComponent.js +141 -0
  14. package/dist/gworld/components/CollideComponent.d.ts +64 -0
  15. package/dist/gworld/components/CollideComponent.d.ts.map +1 -0
  16. package/dist/gworld/components/CollideComponent.js +269 -0
  17. package/dist/gworld/components/EnhancedComponent.d.ts +22 -0
  18. package/dist/gworld/components/EnhancedComponent.d.ts.map +1 -0
  19. package/dist/gworld/components/EnhancedComponent.js +51 -0
  20. package/dist/gworld/components/GUIComponent.d.ts +67 -0
  21. package/dist/gworld/components/GUIComponent.d.ts.map +1 -0
  22. package/dist/gworld/components/GUIComponent.js +166 -0
  23. package/dist/gworld/components/NoRenderComponent.d.ts +38 -0
  24. package/dist/gworld/components/NoRenderComponent.d.ts.map +1 -0
  25. package/dist/gworld/components/NoRenderComponent.js +81 -0
  26. package/dist/gworld/components/NodeComp.d.ts +152 -0
  27. package/dist/gworld/components/NodeComp.d.ts.map +1 -0
  28. package/dist/gworld/components/NodeComp.js +405 -0
  29. package/dist/gworld/components/RenderComponent.d.ts +58 -0
  30. package/dist/gworld/components/RenderComponent.d.ts.map +1 -0
  31. package/dist/gworld/components/RenderComponent.js +166 -0
  32. package/dist/gworld/core/NodePool.d.ts +9 -0
  33. package/dist/gworld/core/NodePool.d.ts.map +1 -0
  34. package/dist/gworld/core/NodePool.js +30 -0
  35. package/dist/gworld/core/Scene.d.ts +5 -0
  36. package/dist/gworld/core/Scene.d.ts.map +1 -0
  37. package/dist/gworld/core/Scene.js +38 -0
  38. package/dist/gworld/core/decorator.d.ts +9 -0
  39. package/dist/gworld/core/decorator.d.ts.map +1 -0
  40. package/dist/gworld/core/decorator.js +43 -0
  41. package/dist/gworld/index.d.ts +8 -0
  42. package/dist/gworld/index.d.ts.map +1 -0
  43. package/dist/gworld/index.js +43 -0
  44. package/dist/gworld/systems/AnimationSystem.d.ts +6 -0
  45. package/dist/gworld/systems/AnimationSystem.d.ts.map +1 -0
  46. package/dist/gworld/systems/AnimationSystem.js +30 -0
  47. package/dist/gworld/systems/CollideSystem.d.ts +20 -0
  48. package/dist/gworld/systems/CollideSystem.d.ts.map +1 -0
  49. package/dist/gworld/systems/CollideSystem.js +171 -0
  50. package/dist/gworld/systems/GUISystem.d.ts +15 -0
  51. package/dist/gworld/systems/GUISystem.d.ts.map +1 -0
  52. package/dist/gworld/systems/GUISystem.js +123 -0
  53. package/dist/gworld/systems/NoRenderSystem.d.ts +16 -0
  54. package/dist/gworld/systems/NoRenderSystem.d.ts.map +1 -0
  55. package/dist/gworld/systems/NoRenderSystem.js +85 -0
  56. package/dist/gworld/systems/RenderSystem.d.ts +22 -0
  57. package/dist/gworld/systems/RenderSystem.d.ts.map +1 -0
  58. package/dist/gworld/systems/RenderSystem.js +104 -0
  59. package/dist/helper/NodePool.d.ts +9 -0
  60. package/dist/helper/NodePool.d.ts.map +1 -0
  61. package/dist/helper/NodePool.js +29 -0
  62. package/dist/helper/html-text-parser.d.ts +30 -0
  63. package/dist/helper/html-text-parser.d.ts.map +1 -0
  64. package/dist/helper/html-text-parser.js +354 -0
  65. package/dist/spine/CCSkeleton.d.ts +1 -188
  66. package/dist/spine/CCSkeleton.d.ts.map +1 -1
  67. package/dist/spine/CCSkeleton.js +127 -103
  68. package/dist/spine/CCSkeletonAnimation.d.ts +6 -136
  69. package/dist/spine/CCSkeletonAnimation.d.ts.map +1 -1
  70. package/dist/spine/CCSkeletonAnimation.js +101 -95
  71. package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts.map +1 -1
  72. package/dist/spine/CCSkeletonCanvasRenderCmd.js +3 -6
  73. package/dist/spine/CCSkeletonTexture.d.ts +1 -24
  74. package/dist/spine/CCSkeletonTexture.d.ts.map +1 -1
  75. package/dist/spine/CCSkeletonTexture.js +6 -4
  76. package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts +1 -27
  77. package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts.map +1 -1
  78. package/dist/spine/CCSkeletonWebGLRenderCmd.js +247 -243
  79. package/dist/spine/PixiSpineSprite.d.ts +19 -0
  80. package/dist/spine/PixiSpineSprite.d.ts.map +1 -0
  81. package/dist/spine/PixiSpineSprite.js +72 -0
  82. package/package.json +1 -1
@@ -31,8 +31,9 @@ import { WebGLRenderCmd } from './CCSkeletonWebGLRenderCmd';
31
31
  /**
32
32
  * The main namespace of Spine, all classes, functions, properties and constants of Spine are defined in this namespace
33
33
  * @namespace
34
- * @name
34
+ * @name gworld
35
35
  */
36
+ var gworld = gworld || {};
36
37
  /**
37
38
  * <p>
38
39
  * The skeleton of Spine. <br/>
@@ -43,96 +44,107 @@ import { WebGLRenderCmd } from './CCSkeletonWebGLRenderCmd';
43
44
  * @class
44
45
  * @extends cc.Node
45
46
  */
46
- export class Skeleton extends cc.Node {
47
- _skeleton = null;
48
- _rootBone = null;
49
- _timeScale = 1;
50
- _debugSlots = false;
51
- _debugBones = false;
52
- _premultipliedAlpha;
53
- _ownsSkeletonData = null;
54
- _atlas = null;
55
- constructor(skeletonDataFile, atlasFile, scale) {
56
- super();
57
- super.init();
58
- this._premultipliedAlpha = cc._renderType === cc.game.RENDER_TYPE_WEBGL && cc.OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA;
59
- this.initWithArgs(skeletonDataFile, atlasFile, scale);
60
- }
61
- _createRenderCmd() {
47
+ gworld.Skeleton = cc.Node.extend(
48
+ /** @lends gworld.Skeleton# */ {
49
+ _skeleton: null,
50
+ _rootBone: null,
51
+ _timeScale: 1,
52
+ _debugSlots: false,
53
+ _debugBones: false,
54
+ _premultipliedAlpha: false,
55
+ _ownsSkeletonData: null,
56
+ _atlas: null,
57
+ /**
58
+ * The constructor of gworld.Skeleton. override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
59
+ */
60
+ ctor: function (skeletonDataFile, atlasFile, scale) {
61
+ cc.Node.prototype.ctor.call(this);
62
+ if (arguments.length === 0)
63
+ this.init();
64
+ else
65
+ this.initWithArgs(skeletonDataFile, atlasFile, scale);
66
+ },
67
+ _createRenderCmd: function () {
62
68
  if (cc._renderType === cc.game.RENDER_TYPE_CANVAS)
63
69
  return new CanvasRenderCmd(this);
64
70
  else
65
71
  return new WebGLRenderCmd(this);
66
- }
67
- onEnter() {
68
- super.onEnter();
72
+ },
73
+ /**
74
+ * Initializes a gworld.Skeleton. please do not call this function by yourself, you should pass the parameters to constructor to initialize it.
75
+ */
76
+ init: function () {
77
+ cc.Node.prototype.init.call(this);
78
+ this._premultipliedAlpha = cc._renderType === cc.game.RENDER_TYPE_WEBGL && cc.OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA;
79
+ },
80
+ onEnter: function () {
81
+ cc.Node.prototype.onEnter.call(this);
69
82
  this.scheduleUpdate();
70
- }
71
- onExit() {
83
+ },
84
+ onExit: function () {
72
85
  this.unscheduleUpdate();
73
- super.onExit();
74
- }
86
+ cc.Node.prototype.onExit.call(this);
87
+ },
75
88
  /**
76
89
  * Sets whether open debug slots.
77
90
  * @param {boolean} enable true to open, false to close.
78
91
  */
79
- setDebugSolots(enable) {
92
+ setDebugSolots: function (enable) {
80
93
  this._debugSlots = enable;
81
- }
94
+ },
82
95
  /**
83
96
  * Sets whether open debug bones.
84
97
  * @param {boolean} enable
85
98
  */
86
- setDebugBones(enable) {
99
+ setDebugBones: function (enable) {
87
100
  this._debugBones = enable;
88
- }
101
+ },
89
102
  /**
90
103
  * Sets whether open debug slots.
91
104
  * @param {boolean} enabled true to open, false to close.
92
105
  */
93
- setDebugSlotsEnabled(enabled) {
106
+ setDebugSlotsEnabled: function (enabled) {
94
107
  this._debugSlots = enabled;
95
- }
108
+ },
96
109
  /**
97
110
  * Gets whether open debug slots.
98
111
  * @returns {boolean} true to open, false to close.
99
112
  */
100
- getDebugSlotsEnabled() {
113
+ getDebugSlotsEnabled: function () {
101
114
  return this._debugSlots;
102
- }
115
+ },
103
116
  /**
104
117
  * Sets whether open debug bones.
105
118
  * @param {boolean} enabled
106
119
  */
107
- setDebugBonesEnabled(enabled) {
120
+ setDebugBonesEnabled: function (enabled) {
108
121
  this._debugBones = enabled;
109
- }
122
+ },
110
123
  /**
111
124
  * Gets whether open debug bones.
112
125
  * @returns {boolean} true to open, false to close.
113
126
  */
114
- getDebugBonesEnabled() {
127
+ getDebugBonesEnabled: function () {
115
128
  return this._debugBones;
116
- }
129
+ },
117
130
  /**
118
- * Sets the time scale of Skeleton.
131
+ * Sets the time scale of gworld.Skeleton.
119
132
  * @param {Number} scale
120
133
  */
121
- setTimeScale(scale) {
134
+ setTimeScale: function (scale) {
122
135
  this._timeScale = scale;
123
- }
124
- getTimeScale() {
136
+ },
137
+ getTimeScale: function () {
125
138
  return this._timeScale;
126
- }
139
+ },
127
140
  /**
128
- * Initializes Skeleton with Data.
129
- * @param {.spine.SkeletonData|String} skeletonDataFile
141
+ * Initializes gworld.Skeleton with Data.
142
+ * @param {gworld.spine.SkeletonData|String} skeletonDataFile
130
143
  * @param {String|spine.Atlas|spine.SkeletonData} atlasFile atlas filename or atlas data or owns SkeletonData
131
144
  * @param {Number} [scale] scale can be specified on the JSON or binary loader which will scale the bone positions, image sizes, and animation translations.
132
145
  */
133
- initWithArgs(skeletonDataFile, atlasFile, scale) {
134
- const argSkeletonFile = skeletonDataFile, argAtlasFile = atlasFile;
135
- let skeletonData, atlas, ownsSkeletonData;
146
+ initWithArgs: function (skeletonDataFile, atlasFile, scale) {
147
+ let argSkeletonFile = skeletonDataFile, argAtlasFile = atlasFile, skeletonData, atlas, ownsSkeletonData;
136
148
  if (cc.isString(argSkeletonFile)) {
137
149
  if (cc.isString(argAtlasFile)) {
138
150
  const data = cc.loader.getRes(argAtlasFile);
@@ -158,15 +170,14 @@ export class Skeleton extends cc.Node {
158
170
  }
159
171
  this.setSkeletonData(skeletonData, ownsSkeletonData);
160
172
  this.init();
161
- }
173
+ },
162
174
  /**
163
- * Returns the bounding box of Skeleton.
175
+ * Returns the bounding box of gworld.Skeleton.
164
176
  * @returns {cc.Rect}
165
177
  */
166
- getBoundingBox() {
178
+ getBoundingBox: function () {
167
179
  let minX = cc.FLT_MAX, minY = cc.FLT_MAX, maxX = cc.FLT_MIN, maxY = cc.FLT_MIN;
168
- const scaleX = this.getScaleX(), scaleY = this.getScaleY(), slots = this._skeleton.slots, VERTEX = spine.RegionAttachment;
169
- let vertices;
180
+ let scaleX = this.getScaleX(), scaleY = this.getScaleY(), vertices, slots = this._skeleton.slots, VERTEX = spine.RegionAttachment;
170
181
  for (let i = 0, slotCount = slots.length; i < slotCount; ++i) {
171
182
  const slot = slots[i];
172
183
  const attachment = slot.attachment;
@@ -181,92 +192,92 @@ export class Skeleton extends cc.Node {
181
192
  }
182
193
  const position = this.getPosition();
183
194
  return cc.rect(position.x + minX, position.y + minY, maxX - minX, maxY - minY);
184
- }
195
+ },
185
196
  /**
186
197
  * Computes the world SRT from the local SRT for each bone.
187
198
  */
188
- updateWorldTransform() {
199
+ updateWorldTransform: function () {
189
200
  this._skeleton.updateWorldTransform(true);
190
- }
201
+ },
191
202
  /**
192
203
  * Sets the bones and slots to the setup pose.
193
204
  */
194
- setToSetupPose() {
205
+ setToSetupPose: function () {
195
206
  this._skeleton.setToSetupPose();
196
- }
207
+ },
197
208
  /**
198
209
  * Sets the bones to the setup pose, using the values from the `BoneData` list in the `SkeletonData`.
199
210
  */
200
- setBonesToSetupPose() {
211
+ setBonesToSetupPose: function () {
201
212
  this._skeleton.setBonesToSetupPose();
202
- }
213
+ },
203
214
  /**
204
215
  * Sets the slots to the setup pose, using the values from the `SlotData` list in the `SkeletonData`.
205
216
  */
206
- setSlotsToSetupPose() {
217
+ setSlotsToSetupPose: function () {
207
218
  this._skeleton.setSlotsToSetupPose();
208
- }
219
+ },
209
220
  /**
210
221
  * Finds a bone by name. This does a string comparison for every bone.
211
222
  * @param {String} boneName
212
- * @returns {.spine.Bone}
223
+ * @returns {gworld.spine.Bone}
213
224
  */
214
- findBone(boneName) {
225
+ findBone: function (boneName) {
215
226
  return this._skeleton.findBone(boneName);
216
- }
227
+ },
217
228
  /**
218
229
  * Finds a slot by name. This does a string comparison for every slot.
219
230
  * @param {String} slotName
220
- * @returns {.spine.Slot}
231
+ * @returns {gworld.spine.Slot}
221
232
  */
222
- findSlot(slotName) {
233
+ findSlot: function (slotName) {
223
234
  return this._skeleton.findSlot(slotName);
224
- }
235
+ },
225
236
  /**
226
237
  * 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.
227
238
  * @param {string} skinName
228
- * @returns {.spine.Skin}
239
+ * @returns {gworld.spine.Skin}
229
240
  */
230
- setSkin(skinName) {
241
+ setSkin: function (skinName) {
231
242
  return this._skeleton.setSkinByName(skinName);
232
- }
243
+ },
233
244
  /**
234
245
  * Returns the attachment for the slot and attachment name. The skeleton looks first in its skin, then in the skeleton data’s default skin.
235
246
  * @param {String} slotName
236
247
  * @param {String} attachmentName
237
- * @returns {.spine.Attachment}
248
+ * @returns {gworld.spine.Attachment}
238
249
  */
239
- getAttachment(slotName, attachmentName) {
250
+ getAttachment: function (slotName, attachmentName) {
240
251
  return this._skeleton.getAttachmentByName(slotName, attachmentName);
241
- }
252
+ },
242
253
  /**
243
254
  * Sets the attachment for the slot and attachment name. The skeleton looks first in its skin, then in the skeleton data’s default skin.
244
255
  * @param {String} slotName
245
256
  * @param {String} attachmentName
246
257
  */
247
- setAttachment(slotName, attachmentName) {
258
+ setAttachment: function (slotName, attachmentName) {
248
259
  this._skeleton.setAttachment(slotName, attachmentName);
249
- }
260
+ },
250
261
  /**
251
- * Sets the premultiplied alpha value to Skeleton.
262
+ * Sets the premultiplied alpha value to gworld.Skeleton.
252
263
  * @param {Number} alpha
253
264
  */
254
- setPremultipliedAlpha(premultiplied) {
265
+ setPremultipliedAlpha: function (premultiplied) {
255
266
  this._premultipliedAlpha = premultiplied;
256
- }
267
+ },
257
268
  /**
258
269
  * Returns whether to enable premultiplied alpha.
259
270
  * @returns {boolean}
260
271
  */
261
- isPremultipliedAlpha() {
272
+ isPremultipliedAlpha: function () {
262
273
  return this._premultipliedAlpha;
263
- }
274
+ },
264
275
  /**
265
- * Sets skeleton data to Skeleton.
266
- * @param {.spine.SkeletonData} skeletonData
267
- * @param {.spine.SkeletonData} ownsSkeletonData
276
+ * Sets skeleton data to gworld.Skeleton.
277
+ * @param {gworld.spine.SkeletonData} skeletonData
278
+ * @param {gworld.spine.SkeletonData} ownsSkeletonData
268
279
  */
269
- setSkeletonData(skeletonData, ownsSkeletonData) {
280
+ setSkeletonData: function (skeletonData, ownsSkeletonData) {
270
281
  if (skeletonData.width != null && skeletonData.height != null)
271
282
  this.setContentSize(skeletonData.width / cc.director.getContentScaleFactor(), skeletonData.height / cc.director.getContentScaleFactor());
272
283
  this._skeleton = new spine.Skeleton(skeletonData);
@@ -274,20 +285,20 @@ export class Skeleton extends cc.Node {
274
285
  this._rootBone = this._skeleton.getRootBone();
275
286
  this._ownsSkeletonData = ownsSkeletonData;
276
287
  this._renderCmd._createChildFormSkeletonData();
277
- }
288
+ },
278
289
  /**
279
290
  * Return the renderer of attachment.
280
- * @param {.spine.RegionAttachment|.spine.BoundingBoxAttachment} regionAttachment
281
- * @returns {.spine.TextureAtlasRegion}
291
+ * @param {gworld.spine.RegionAttachment|gworld.spine.BoundingBoxAttachment} regionAttachment
292
+ * @returns {gworld.spine.TextureAtlasRegion}
282
293
  */
283
- getTextureAtlas(regionAttachment) {
294
+ getTextureAtlas: function (regionAttachment) {
284
295
  return regionAttachment.region;
285
- }
296
+ },
286
297
  /**
287
- * Returns the blendFunc of Skeleton.
298
+ * Returns the blendFunc of gworld.Skeleton.
288
299
  * @returns {cc.BlendFunc}
289
300
  */
290
- getBlendFunc() {
301
+ getBlendFunc: function () {
291
302
  const slot = this._skeleton.drawOrder[0];
292
303
  if (slot) {
293
304
  const blend = this._renderCmd._getBlendFunc(slot.data.blendMode, this._premultipliedAlpha);
@@ -296,25 +307,38 @@ export class Skeleton extends cc.Node {
296
307
  else {
297
308
  return {};
298
309
  }
299
- }
300
- setBlendFunc() {
310
+ },
311
+ /**
312
+ * Sets the blendFunc of gworld.Skeleton, it won't have any effect for skeleton, skeleton is using slot's data to determine the blend function.
313
+ * @param {cc.BlendFunc|Number} src
314
+ * @param {Number} [dst]
315
+ */
316
+ setBlendFunc: function (src, dst) {
301
317
  return;
302
- }
318
+ },
303
319
  /**
304
320
  * Update will be called automatically every frame if "scheduleUpdate" is called when the node is "live".
305
321
  * @param {Number} dt Delta time since last update
306
322
  */
307
- update(dt) {
323
+ update: function (dt) {
308
324
  this._skeleton.update(dt);
309
- }
310
- // Static create method
311
- static create(skeletonDataFile, atlasFile, scale) {
312
- return new Skeleton(skeletonDataFile, atlasFile, scale);
313
- }
314
- }
315
- cc.defineGetterSetter(Skeleton.prototype, 'opacityModifyRGB', Skeleton.prototype.isOpacityModifyRGB);
325
+ },
326
+ });
327
+ cc.defineGetterSetter(gworld.Skeleton.prototype, 'opacityModifyRGB', gworld.Skeleton.prototype.isOpacityModifyRGB);
316
328
  // For renderer webgl to identify skeleton's default texture and blend function
317
- cc.defineGetterSetter(Skeleton.prototype, '_blendFunc', Skeleton.prototype.getBlendFunc);
318
- cc.defineGetterSetter(Skeleton.prototype, '_texture', function () {
329
+ cc.defineGetterSetter(gworld.Skeleton.prototype, '_blendFunc', gworld.Skeleton.prototype.getBlendFunc);
330
+ cc.defineGetterSetter(gworld.Skeleton.prototype, '_texture', function () {
319
331
  return this._renderCmd._currTexture;
320
332
  });
333
+ /**
334
+ * Creates a skeleton object.
335
+ * @deprecated since v3.0, please use new gworld.Skeleton(skeletonDataFile, atlasFile, scale) instead.
336
+ * @param {spine.SkeletonData|String} skeletonDataFile
337
+ * @param {String|spine.Atlas|spine.SkeletonData} atlasFile atlas filename or atlas data or owns SkeletonData
338
+ * @param {Number} [scale] scale can be specified on the JSON or binary loader which will scale the bone positions, image sizes, and animation translations.
339
+ * @returns {gworld.Skeleton}
340
+ */
341
+ gworld.Skeleton.create = function (skeletonDataFile, atlasFile /* or atlas*/, scale) {
342
+ return new gworld.Skeleton(skeletonDataFile, atlasFile, scale);
343
+ };
344
+ export const Skeleton = gworld.Skeleton;
@@ -1,146 +1,16 @@
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
1
  export declare const _atlasLoader: {
28
2
  spAtlasFile: any;
29
3
  setAtlasFile: (spAtlasFile: any) => void;
30
4
  load: (line: any) => any;
31
- unload: () => void;
5
+ unload: (obj: any) => void;
32
6
  };
33
7
  /**
34
8
  * The skeleton animation of spine. It updates animation's state and skeleton's world transform.
35
9
  * @class
36
- * @extends Skeleton
10
+ * @extends gworld.Skeleton
11
+ * @example
12
+ * var spineBoy = new SkeletonAnimation('res/skeletons/spineboy.json', 'res/skeletons/spineboy.atlas');
13
+ * this.addChild(spineBoy, 4);
37
14
  */
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
- }
15
+ export declare const SkeletonAnimation: any;
146
16
  //# sourceMappingURL=CCSkeletonAnimation.d.ts.map
@@ -1 +1 @@
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,CAAA;AAkGD;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,MAAM,EAAE,GAAG,CAAO;IAClB,uBAAuB,UAAQ;IAC/B,SAAS,EAAE,GAAG,CAAO;gBAET,gBAAgB,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM;IAMnE;;;OAGG;IACH,qBAAqB,CAAC,SAAS,EAAE,GAAG;IAOpC;;;;;OAKG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAInE;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAM/C;;;;;;OAMG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IAS5D;;;;;;;OAOG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM;IAU5E;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM;IAI1B;;;;OAIG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM;IAI7B;;OAEG;IACH,WAAW;IAIX;;;OAGG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM;IAI7B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM;IAUjB;;;OAGG;IACH,gBAAgB,CAAC,QAAQ,EAAE,GAAG;IAI9B;;;OAGG;IACH,oBAAoB,CAAC,QAAQ,EAAE,GAAG;IAIlC;;;OAGG;IACH,cAAc,CAAC,QAAQ,EAAE,GAAG;IAI5B;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,GAAG;IAIhC,mBAAmB,CAAC,QAAQ,EAAE,GAAG;IAIjC,gBAAgB,CAAC,QAAQ,EAAE,GAAG;IAI9B,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
+ {"version":3,"file":"CCSkeletonAnimation.d.ts","sourceRoot":"","sources":["../../src/spine/CCSkeletonAnimation.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,YAAY;;;;;CAaxB,CAAA;AA2FD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,KAuM5B,CAAA"}