diff --git a/extends.js b/extends.js index 5f9dc9c218..8c950df659 100644 --- a/extends.js +++ b/extends.js @@ -26,8 +26,8 @@ require('./cocos2d/core'); require('./cocos2d/animation'); require('./cocos2d/particle/CCParticleAsset'); - if (!(CC_EDITOR && Editor.isCoreLevel)) { require('./cocos2d/particle/CCParticleSystem'); - require('./extensions/spine'); } + +require('./extensions/spine'); diff --git a/extensions/spine/CCSkeleton.js b/extensions/spine/Skeleton.js similarity index 99% rename from extensions/spine/CCSkeleton.js rename to extensions/spine/Skeleton.js index 8abbadf2bd..8cadc1f618 100644 --- a/extensions/spine/CCSkeleton.js +++ b/extensions/spine/Skeleton.js @@ -2,6 +2,7 @@ Copyright (c) 2011-2012 cocos2d-x.org Copyright (c) 2013-2014 Chukong Technologies Inc. Copyright (c) 2014 Shengxiang Chen (Nero Chan) + Copyright (c) 2015-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -26,6 +27,10 @@ var spine = require('./spine-exported'); +/** + * @module sp + */ + /** * The vertex index of spine. * @constant diff --git a/extensions/spine/CCSkeletonAnimation.js b/extensions/spine/SkeletonAnimation.js similarity index 99% rename from extensions/spine/CCSkeletonAnimation.js rename to extensions/spine/SkeletonAnimation.js index 35576c0c5d..edfc167f02 100644 --- a/extensions/spine/CCSkeletonAnimation.js +++ b/extensions/spine/SkeletonAnimation.js @@ -2,6 +2,7 @@ Copyright (c) 2011-2012 cocos2d-x.org Copyright (c) 2013-2014 Chukong Technologies Inc. Copyright (c) 2014 Shengxiang Chen (Nero Chan) + Copyright (c) 2015-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -27,8 +28,9 @@ var spine = require('./spine-exported'); /** - * @ignore + * @module sp */ + sp._atlasPage_createTexture_webGL = function (self, path) { var texture = cc.textureCache.addImage(path); self.rendererObject = new cc.TextureAtlas(texture, 128); diff --git a/extensions/spine/CCSkeletonCanvasRenderCmd.js b/extensions/spine/SkeletonCanvasRenderCmd.js similarity index 99% rename from extensions/spine/CCSkeletonCanvasRenderCmd.js rename to extensions/spine/SkeletonCanvasRenderCmd.js index 19e102eca3..5f33707590 100644 --- a/extensions/spine/CCSkeletonCanvasRenderCmd.js +++ b/extensions/spine/SkeletonCanvasRenderCmd.js @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -24,6 +24,10 @@ var spine = require('./spine-exported'); +/** + * @module sp + */ + sp.Skeleton.CanvasRenderCmd = function(renderableObject){ _ccsg.Node.CanvasRenderCmd.call(this, renderableObject); this._needDraw = true; diff --git a/extensions/spine/CCSkeletonWebGLRenderCmd.js b/extensions/spine/SkeletonWebGLRenderCmd.js similarity index 99% rename from extensions/spine/CCSkeletonWebGLRenderCmd.js rename to extensions/spine/SkeletonWebGLRenderCmd.js index 4539883e9d..78a9363775 100644 --- a/extensions/spine/CCSkeletonWebGLRenderCmd.js +++ b/extensions/spine/SkeletonWebGLRenderCmd.js @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -24,6 +24,10 @@ var spine = require('./spine-exported'); +/** + * @module sp + */ + sp.Skeleton.WebGLRenderCmd = function (renderableObject) { _ccsg.Node.WebGLRenderCmd.call(this, renderableObject); this._needDraw = true; diff --git a/extensions/spine/SpineAsset.js b/extensions/spine/SpineAsset.js new file mode 100644 index 0000000000..9bb126170e --- /dev/null +++ b/extensions/spine/SpineAsset.js @@ -0,0 +1,40 @@ +/**************************************************************************** + Copyright (c) 2016 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +/** + * @module sp + */ + +/** + * The skeleton data of spine. + * @class SpineAsset + * @extends RawAsset + * @constructor + */ +var SpineAsset = cc.Class({ + name: 'sp.SpineAsset', + extends: cc.RawAsset, +}); + +sp.SpineAsset = module.exports = SpineAsset; diff --git a/extensions/spine/index.js b/extensions/spine/index.js new file mode 100644 index 0000000000..0bb1cdf240 --- /dev/null +++ b/extensions/spine/index.js @@ -0,0 +1,40 @@ +/**************************************************************************** + Copyright (c) 2016 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +/** + * The global main namespace of Spine, all classes, functions, properties and constants of Spine are defined in this namespace + * @module sp + * @main sp + */ + +sp = {}; + +if (!CC_EDITOR || !Editor.isCoreLevel) { + require('./Skeleton'); + require('./SkeletonCanvasRenderCmd'); + require('./SkeletonWebGLRenderCmd'); + require('./SkeletonAnimation'); +} + +require('./SpineAsset');