From 54330576e60f70ec78d3b571439217d9008b4daa Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 24 Jul 2015 20:16:01 +0800 Subject: [PATCH] Fix JS binding issues for skeleton animation --- .../js-bindings/script/studio/jsb_studio_boot.js | 2 +- .../js-bindings/script/studio/jsb_studio_create_apis.js | 9 +++++++++ tools/tojs/cocos2dx_studio.ini | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js b/cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js index 4c38677bd1..e64312fc7e 100644 --- a/cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js +++ b/cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js @@ -68,6 +68,6 @@ ccs.Sprite.extend = ccs.Sprite.extend || cc.Sprite.extend; ccs.Component = ccs.Component || cc.Component; ccs.Component.extend = ccs.Component.extend || cc.Component.extend; -ccs.SkinNode.extend = cc.Class.extend; +ccs.SkinNode = cc.Node; ccs.BoneNode.extend = cc.Class.extend; ccs.SkeletonNode.extend = cc.Class.extend; \ No newline at end of file diff --git a/cocos/scripting/js-bindings/script/studio/jsb_studio_create_apis.js b/cocos/scripting/js-bindings/script/studio/jsb_studio_create_apis.js index ebcd413752..f74a726fa2 100644 --- a/cocos/scripting/js-bindings/script/studio/jsb_studio_create_apis.js +++ b/cocos/scripting/js-bindings/script/studio/jsb_studio_create_apis.js @@ -100,4 +100,13 @@ ccs.ActionTimelineData.prototype._ctor = function(actionTag) { ccs.ComExtensionData.prototype._ctor = function() { ccs.ComExtensionData.prototype.init.call(this); +}; + +ccs.BoneNode.prototype._ctor = function (length) { + ccs.BoneNode.prototype.init.call(this); + length !== undefined && this.setDebugDrawLength(length); +}; + +ccs.SkeletonNode.prototype._ctor = function () { + ccs.SkeletonNode.prototype.init.call(this); }; \ No newline at end of file diff --git a/tools/tojs/cocos2dx_studio.ini b/tools/tojs/cocos2dx_studio.ini index 6f90e5c19c..57f9fa4cf0 100644 --- a/tools/tojs/cocos2dx_studio.ini +++ b/tools/tojs/cocos2dx_studio.ini @@ -27,7 +27,7 @@ headers = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h %(cocosdir)s # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Armature ArmatureAnimation Skin Bone ColliderDetector ColliderBody ArmatureDataManager InputDelegate ComController ComAudio ComAttribute ComRender ActionManagerEx SceneReader GUIReader BatchNode ActionObject BaseData Tween ColliderFilter DisplayManager DecorativeDisplay ProcessBase AnimationData MovementData ContourData TextureData ActionTimelineData ActionTimeline ActionTimelineCache Frame TextureFrame RotationFrame SkewFrame VisibleFrame RotationSkewFrame PositionFrame ScaleFrame AnchorPointFrame InnerActionFrame ColorFrame AlphaFrame EventFrame ZOrderFrame NodeReader Timeline CSLoader ComExtensionData BoneNode SkinNode SkeletonNode +classes = Armature ArmatureAnimation Skin Bone ColliderDetector ColliderBody ArmatureDataManager InputDelegate ComController ComAudio ComAttribute ComRender ActionManagerEx SceneReader GUIReader BatchNode ActionObject BaseData Tween ColliderFilter DisplayManager DecorativeDisplay ProcessBase AnimationData MovementData ContourData TextureData ActionTimelineData ActionTimeline ActionTimelineCache Frame TextureFrame RotationFrame SkewFrame VisibleFrame RotationSkewFrame PositionFrame ScaleFrame AnchorPointFrame InnerActionFrame ColorFrame AlphaFrame EventFrame ZOrderFrame NodeReader Timeline CSLoader ComExtensionData BoneNode SkeletonNode # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also