当前位置: 首页>>代码示例>>C++>>正文


C++ Equipment::getAllMofaShuxing方法代码示例

本文整理汇总了C++中Equipment::getAllMofaShuxing方法的典型用法代码示例。如果您正苦于以下问题:C++ Equipment::getAllMofaShuxing方法的具体用法?C++ Equipment::getAllMofaShuxing怎么用?C++ Equipment::getAllMofaShuxing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Equipment的用法示例。


在下文中一共展示了Equipment::getAllMofaShuxing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getItemContentByIndex


//.........这里部分代码省略.........
    else
    {
        CCLabelTTF* label;
        label = LF::lable(bg,"",ccp(left_x_start,87),20,fontStr_kaiti);
        label->setTag(TAG_BaseBody_LABLE_SHANGHAIXIANGXI_NUM);
        CCLabelTTF* label2;
        label2 = LF::lable(bg,""
                           ,ccp(label->getPosition().x + label->getContentSize().width, label->getPositionY()),20,fontStr_kaiti);
        label2->setTag(TAG_BaseBody_LABLE_SHANGHAIXIANGXI_TXT);
    }

    //等级
    {
        CCLabelTTF* label;
        char str[64];
        sprintf(str, "%s %u ", LFStrings::getValue("dengji").c_str(), mEquipmentVec[index]->getEquipData().zhuangbei_level);
        label = LF::lable(bg,str,ccp(left_x_start,28),20,fontStr_kaiti);
        label->setColor(fonColor_FaGuang);
        label->setTag(TAG_BaseBody_LABLE_Level);
    }

    //人物
    {
        CCLabelTTF* label;
        int actorId = mEquipmentVec[index]->getActorId();
        if (actorId != INVALID_ID)
        {
            BaseActor* actor = MyselfManager::getManager()->getMyTeamActor(actorId);
            CCAssert(actor!=NULL,"");
            BaseActorProperty prop = actor->getCurrentProperty();
            label = LF::lable(bg,LF::getString("zhuangBeiYu")+prop.nameInChinese,ccp(0, 0),20,fontStr_kaiti);
        }
        else
        {
            label = LF::lable(bg,LF::getString("meiYouZhuangBei"),ccp(0, 0),20,fontStr_kaiti);
        }
        label->setColor(fonColor_FaGuang);
        label->setAnchorPoint(ccp(1, 0.5));
        label->setPosition(ccp( 590, 200));
        label->setTag(TAG_BaseBody_LABLE_OWNTO);
        if (actorId == INVALID_ID && mEquipmentVec[index]->getEquipData().profession_id != 0)
        {
            CCString temp;
            temp.initWithFormat("%s(%s)", LFStrings::getValue("ZhiYeXianZhi").c_str(),
                                BaseActorPropertyParser::getParser()->getExtraProerty((Profession)mEquipmentVec[index]->getEquipData().profession_id).nameInChinese.c_str());
            label->setString(temp.getCString());
            label->setColor(fonColor_JingGao);
        }
    }

    //魔法属性
    {
        int start_x = 400 + 38;
        Equipment* equip = mEquipmentVec[index];
        std::vector<std::string> vec = equip->getAllMofaShuxing(false);

        //大于5个  第五个就是 ......
        for(int i=0; i<vec.size(); ++i)
        {
            std::string txt = vec[i];

            BaseSprite* biaoji = BaseSprite::create("zhuangbei_xiangxi_biaoji.png");
            bg->addChild(biaoji, 0, TAG_BIAOJI+i);
            biaoji->setPosition(ccp(start_x, 170-i*28));
            //biaoji->setOpacity(80);

            CCLabelTTF* label;
            label = LF::lable(bg,txt,ccp(0,0),20,fontStr_kaiti);
            label->setColor(ImageManager::getManager()->getShowColor(ZhuangbeiColour_Fumo, false, false));
            label->setAnchorPoint(ccp(0, 0.5));
            label->setPosition(ccp(start_x+15, 170-i*28));
            label->setTag(i);

            if(vec.size()>6)
            {
                CCLog("Warrior:%s ---> equipment property > 6, current is [%d]", __FUNCTION__, vec.size());
                //	break;
            }
        }
        //洗练
        string xxx;
        CCSprite *diwen = (CCSprite*)bg->getChildByTag(TAG_BaseBody_TABLE_ITEM_DiWen);
        if (equip->canPurify(xxx,1) && diwen)
        {
            ZhuangbeiOptionLevel *layer = ZhuangbeiOptionLevel::createWithEquipment(equip);
            bg->addChild(layer,20);
            //layer->setScale(1/diwen->getScale());
            CCPoint pos = diwen->getPosition();
            pos.x -= diwen->getContentSize().width * diwen->getScaleX() / 2;
            pos.y -= diwen->getContentSize().height * diwen->getScaleY() / 2;

            int width = pos.x + layer->getContentSize().width / 2 + 12;
            int height = pos.y + layer->getContentSize().height / 2 + 4;
            layer->setPosition(ccp(width,height));
        }
    }

    bg->setPosition(ccp(bg->getContentSize().width/2,bg->getContentSize().height/2));
    return bg;
}
开发者ID:longguai,项目名称:game-DarkWar,代码行数:101,代码来源:MainLayerZhuangBeiBaseBody.cpp


注:本文中的Equipment::getAllMofaShuxing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。