September 2014
Beginner
266 pages
5h 38m
English
If you want to test the animations in the current project itself, add the following to the HelloWorldScene.h file first:
#include <spine/spine-cocos2dx.h>
Include the spine header file and create a variable named skeletonNode of the CCSkeletalAnimation type:
extension::CCSkeletonAnimation* skeletonNode;
Next, we initialize the skeletonNode variable in the HelloWorldScene.cpp file:
skeletonNode = extension::CCSkeletonAnimation::createWithFile("player.json", "player.atlas", 1.0f);
skeletonNode->addAnimation("runCycle",true,0,0);
skeletonNode->setPosition(ccp(visibleSize.width/2 , skeletonNode->getContentSize().height/2));
addChild(skeletonNode);Here, we give the two data files into the createWithFile() function of CCSkeletonAnimation ...
Read now
Unlock full access