[Custom] Armature

Adding A Armature

Drag a Armature from the Custom section onto the middle canvas.

258

Selecting The Armature

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.

250

Modifying The Armature

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.

357

Accessing The Armature In Code

Armature's can be accessed via their Name or Tag which can be set in the Properties section.

351

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.

// this is required at the top of any file using Armature
#include "editor-support/cocostudio/CocoStudio.h"

Node *rootNode = CSLoader::createNode( "Filepath to .csb file" );
this->addChild( rootNode );

// label accessed as a node using it's name
Node *armature = rootNode->getChildByName( "Name set in Cocos Studio" );

// label cast to a label using it's name
cocostudio::Armature *armature = ( cocostudio::Armature * )rootNode->getChildByName( "Name set in Cocos Studio" );

// label accessed as a node using it's tag
Node *armature = rootNode->getChildByTag( 5 );

// label cast to a label using it's tag
cocostudio::Armature *armature = ( cocostudio::Armature * )rootNode->getChildByTag( 5 );