首页 > 其他 > 详细

添加多个CCArmature

时间:2014-02-21 19:41:27      阅读:449      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
CCArmatureDataManager::sharedArmatureDataManager()->
        addArmatureFileInfo("armature\\Cowboy0.png", "armature\\Cowboy0.plist", "armature\\Cowboy.ExportJson");

    for (int i = 0; i < 5; i++)
    {
        cocos2d::extension::CCArmature *armature = cocos2d::extension::CCArmature::create("Cowboy");
        armature->getAnimation()->playWithIndex(0);
        armature->setPosition(ccp(CCDirector::sharedDirector()->getWinSize().width / 2,
            CCDirector::sharedDirector()->getWinSize().height / 2));
        armature->setScale(0.2f);
        addChild(armature, 0, i);
    }

    getChildByTag(0)->setAnchorPoint(ccp(0, 0));
    getChildByTag(1)->setAnchorPoint(ccp(0, 1));
    getChildByTag(2)->setAnchorPoint(ccp(1, 0));
    getChildByTag(3)->setAnchorPoint(ccp(1, 1));
    getChildByTag(4)->setAnchorPoint(ccp(0.5, 0.5));
bubuko.com,布布扣

添加多个CCArmature

原文:http://www.cnblogs.com/newlist/p/3558971.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!