Hello all,
When I export animation from CocoStudio, they have JSON file, PLIST file. How can I use them to load the animation in code?
It’s very useful if you can give me a small example.
Thank you
Hello all,
When I export animation from CocoStudio, they have JSON file, PLIST file. How can I use them to load the animation in code?
It’s very useful if you can give me a small example.
Thank you
cocostudio::ArmatureDataManager::getInstance()->addArmatureFileInfo( FILENAME );
auto arma = cocostudio::Armature::create(ARMATURENAME ); // for me it is .png less filename
arma->getAnimation()->playWithIndex(2); // or use other methdos like play
arma->setPosition(Point(visibleSize.width / 2 + origin.x + 300 - i * 30, visibleSize.height / 2 + origin.y + 100));
arma->getAnimation()->setMovementEventCallFunc(&callback);
#include “cocostudio/CocoStudio.h”
Which is FILENAME? .JSON or .PLIST
For example, CocoStudio exports N02.png, N02.plist and NO2.json. Where can I place them? In the same folder? Thanks!
Delka wrote:
cocostudio::ArmatureDataManager::getInstance()->addArmatureFileInfo( FILENAME );
auto arma = cocostudio::Armature::create(ARMATURENAME ); // for me it is .png less filename
arma->getAnimation()->playWithIndex(2); // or use other methdos like play
arma->setPosition(Point(visibleSize.width / 2 + origin.x + 300 - i * 30, visibleSize.height / 2 + origin.y + 100));arma->getAnimation()->setMovementEventCallFunc(&callback);
yes,just as the folder level exported,
and FILENAME is the “*.Exportson”
you can find example here,
http://upyun.cocimg.com/CocoStudio/helpdoc/v1.0.0.0/en/index.html