{"_id":"54eb801659b1172100334ffc","__v":0,"project":"5463e333447e0a100024a087","category":{"_id":"54e3bef8464a9c3700f7ca67","pages":["54e3bfabe887c50d005ef6a0","54e3c35ee887c50d005ef6af","54e3c9ade887c50d005ef6b4","54e3ca68e887c50d005ef6b6","54e47d6a610dfd0d00b2a84a","54e487250e41ef2b00b996c2","54e48ec60e41ef2b00b996cd","54e5c6e8e662e60d00aff673","54e5d4efe0b92439007d6999","54e5dc0ae0b92439007d69aa","54e72c88e6e77d1900ed10fa","54e7391f3c1e111700d05749","54e73f1a3c1e111700d05757","54e863f5c8e0c00d007abffd","54e86704a64fba0d00846860","54e86abb32b0b00d00c960f2","54e9e881560f2b170087f1d0","54e9eca2a6f14f0d003e96b5","54e9f04d560f2b170087f1d3","54eb2041996da20d00e6d68e","54eb801659b1172100334ffc","54eb8101df7add210007b31a","54ec584cc0c0ba1700386f8d","54ec5adad17b6d2300a54d75","54ec5e077ab3172d00c01aae","54edf8ca1e4ee60d0018e89f","54edfbc0130818170073a16b","54edff0e8dafa7250027e659"],"project":"5463e333447e0a100024a087","__v":28,"version":"5463e333447e0a100024a08a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-17T22:21:44.099Z","from_sync":false,"order":2,"slug":"cocos-studio","title":"Cocos Studio"},"version":{"_id":"5463e333447e0a100024a08a","project":"5463e333447e0a100024a087","__v":6,"createdAt":"2014-11-12T22:46:11.486Z","releaseDate":"2014-11-12T22:46:11.486Z","categories":["5463e333447e0a100024a08b","54645c365871e90800f50151","547b1c5a4366a708001b3b50","547b1cdf4366a708001b3b5a","54e3bef8464a9c3700f7ca67","54ec651d7ab3172d00c01ab7"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"54639d06447e0a1000249f7f","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-02-23T19:31:34.436Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Adding A Armature\"\n}\n[/block]\nDrag a Armature from the Custom section onto the middle canvas.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e23UEUHHTSCkaNtTyPwq_Screen-Shot-2015-02-23-at-12.52.53.png\",\n        \"Screen-Shot-2015-02-23-at-12.52.53.png\",\n        \"258\",\n        \"107\",\n        \"#ef0e0c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Selecting The Armature\"\n}\n[/block]\nYou can select the Armature if it isn't already selected from the **Animation Editor** at the bottom. The Armature doesn't appear in the resources as it's part of the Scene or other object that you are using.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/qU9jeEitSJuXodfIIkFf_Screen-Shot-2015-02-23-at-12.53.10.png\",\n        \"Screen-Shot-2015-02-23-at-12.53.10.png\",\n        \"250\",\n        \"333\",\n        \"#0f74f1\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Modifying The Armature\"\n}\n[/block]\nYou can change the Armature animation file. Setting the Armature's animation file can be done by double clicking on the section or dragging a resource from the Resources section.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5Im5AvLWTcaYnabpzuq2_Screen%20Shot%202015-02-23%20at%2012.53.29.png\",\n        \"Screen Shot 2015-02-23 at 12.53.29.png\",\n        \"357\",\n        \"412\",\n        \"#3b81cd\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Accessing The Armature In Code\"\n}\n[/block]\nArmature's can be accessed via their **Name** or **Tag** which can be set in the **Properties** section.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/DBb8ZJ2bQ3C5fCoXdGqb_Screen%20Shot%202015-02-23%20at%2012.53.38.png\",\n        \"Screen Shot 2015-02-23 at 12.53.38.png\",\n        \"351\",\n        \"80\",\n        \"#5280ba\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nTo access the Armature from a scene for example, in code it is simple. You either access it as a **Node** or cast it to a **Armature** allowing you to use **Armature** methods along with **Node** methods.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// this is required at the top of any file using Armature\\n#include \\\"editor-support/cocostudio/CocoStudio.h\\\"\\n\\nNode *rootNode = CSLoader::createNode( \\\"Filepath to .csb file\\\" );\\nthis->addChild( rootNode );\\n\\n// label accessed as a node using it's name\\nNode *armature = rootNode->getChildByName( \\\"Name set in Cocos Studio\\\" );\\n\\n// label cast to a label using it's name\\ncocostudio::Armature *armature = ( cocostudio::Armature * )rootNode->getChildByName( \\\"Name set in Cocos Studio\\\" );\\n\\n// label accessed as a node using it's tag\\nNode *armature = rootNode->getChildByTag( 5 );\\n\\n// label cast to a label using it's tag\\ncocostudio::Armature *armature = ( cocostudio::Armature * )rootNode->getChildByTag( 5 );\",\n      \"language\": \"cplusplus\",\n      \"name\": \"Cocos2d-x C++\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"custom-armature","type":"basic","title":"[Custom] Armature"}
[block:api-header] { "type": "basic", "title": "Adding A Armature" } [/block] Drag a Armature from the Custom section onto the middle canvas. [block:image] { "images": [ { "image": [ "https://files.readme.io/e23UEUHHTSCkaNtTyPwq_Screen-Shot-2015-02-23-at-12.52.53.png", "Screen-Shot-2015-02-23-at-12.52.53.png", "258", "107", "#ef0e0c", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Selecting The Armature" } [/block] You can select the Armature if it isn't already selected from the **Animation Editor** at the bottom. The Armature doesn't appear in the resources as it's part of the Scene or other object that you are using. [block:image] { "images": [ { "image": [ "https://files.readme.io/qU9jeEitSJuXodfIIkFf_Screen-Shot-2015-02-23-at-12.53.10.png", "Screen-Shot-2015-02-23-at-12.53.10.png", "250", "333", "#0f74f1", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Modifying The Armature" } [/block] You can change the Armature animation file. Setting the Armature's animation file can be done by double clicking on the section or dragging a resource from the Resources section. [block:image] { "images": [ { "image": [ "https://files.readme.io/5Im5AvLWTcaYnabpzuq2_Screen%20Shot%202015-02-23%20at%2012.53.29.png", "Screen Shot 2015-02-23 at 12.53.29.png", "357", "412", "#3b81cd", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Accessing The Armature In Code" } [/block] Armature's can be accessed via their **Name** or **Tag** which can be set in the **Properties** section. [block:image] { "images": [ { "image": [ "https://files.readme.io/DBb8ZJ2bQ3C5fCoXdGqb_Screen%20Shot%202015-02-23%20at%2012.53.38.png", "Screen Shot 2015-02-23 at 12.53.38.png", "351", "80", "#5280ba", "" ] } ] } [/block] To access the Armature from a scene for example, in code it is simple. You either access it as a **Node** or cast it to a **Armature** allowing you to use **Armature** methods along with **Node** methods. [block:code] { "codes": [ { "code": "// this is required at the top of any file using Armature\n#include \"editor-support/cocostudio/CocoStudio.h\"\n\nNode *rootNode = CSLoader::createNode( \"Filepath to .csb file\" );\nthis->addChild( rootNode );\n\n// label accessed as a node using it's name\nNode *armature = rootNode->getChildByName( \"Name set in Cocos Studio\" );\n\n// label cast to a label using it's name\ncocostudio::Armature *armature = ( cocostudio::Armature * )rootNode->getChildByName( \"Name set in Cocos Studio\" );\n\n// label accessed as a node using it's tag\nNode *armature = rootNode->getChildByTag( 5 );\n\n// label cast to a label using it's tag\ncocostudio::Armature *armature = ( cocostudio::Armature * )rootNode->getChildByTag( 5 );", "language": "cplusplus", "name": "Cocos2d-x C++" } ] } [/block]