骨骼动画

来源:互联网 发布:拳击书籍知乎 编辑:程序博客网 时间:2024/04/30 04:31
http://upyun.cocimg.com/CocoStudio/helpdoc/v1.0.0.0/zh/index.html
//从导出文件异步加载动画CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("Cowboy0.png","Cowboy0.plist","Cowboy.ExportJson");//根据动画名称创建动画精灵CCArmature *armature = CCArmature::create("Cowboy");//播放指定动作armature->getAnimation()->playByIndex(0);//修改属性armature->setScale(0.5f);//设置动画精灵位置armature->setPosition(200,300);//添加到当前页面this->addChild(armature,2);
设置了缩放比( setContentScaleFactor(2))后,每块图片会缩小一半,就变成肢解的效果,解决方案1.用放大1倍的plist和png 2.用图片缩小一倍的重做一遍骨骼动画,然后用原图的plist和png
0 0