Exemplo n.º 1
0
	void updateScroll(){
		bool vBar = _scrollBar && _scrollBar->isVisible(),
			vNode = _scrollNode && _scrollNode->isVisible();
		if(!vBar || !vNode){
			return;
		}
		bool vert = getDirection() == kCCScrollViewDirectionVertical;
		CCPoint p, cp = getContentOffset();
		CCSize vs = getViewSize(),
			cs = getContentSize();
		float rate = 1 - (vert? fabsf(cp.y) / (cs.height - vs.height) : fabsf(cp.x) / (cs.width - vs.width));
		if(vBar){
			CCSize ss = _scrollBar->getPreferredSize();
			p = _scrollBar->getPosition();
			if(vert){	p.y = cs.height - (cs.height - ss.height) * rate - ss.height - _scrollTrackDelta;
			}else{		p.x = cs.width - (cs.width - ss.width) * rate - ss.width - _scrollTrackDelta;
			}
			_scrollBar->setPosition(p);
		}
		if(vNode){
			p = _scrollNode->getPosition();
			if(vert){	p.y = cp.y + vs.height * rate;
			}else{		p.x = cp.x + vs.width * rate;
			}
			_scrollNode->setPosition(p);
		}
		if(_scrollTrack){
			p = _scrollTrack->getPosition();
			if(vert){	p.y = fabsf(cp.y);
			}else{		p.x = fabsf(cp.x);
			}
			_scrollTrack->setPosition(p);
		}
//CCLog("LuaTableView.updateScroll ss=%d,%d vh=%d cy=%d ch=%d y=%d", (int)ss.width, (int)ss.height, (int)vs.height, (int)p.y, (int)cs.height, (int)_scrollBar->getPositionY());
	}
Exemplo n.º 2
0
void PopCancelLayer::onEnter(){
	PopLayer::onEnter();
	CCMenuItemImage* cancelBtn = CCMenuItemImage::create("strangedesign/Dlg_cancel_button.png",
		"strangedesign/Dlg_cancel_button_down.png",
		this,
		menu_selector(PopCancelLayer::cancelCallback));
	CCScale9Sprite* background = getSprite9BackGround();
	CCPoint centerDlg = background->getPosition();
	CCSize backgroundSize = background->getContentSize();
	CCPoint rightCorner = centerDlg+ccp(backgroundSize.width/2, backgroundSize.height/2);
	CCSize cancelImgSize = cancelBtn->getContentSize();
	cancelBtn->setPosition(rightCorner-ccp(cancelImgSize.width/2,cancelImgSize.height/2));
	getMenuButton()->addChild(cancelBtn);
}
bool CCControlPotentiometerTest::init()
{
    if (CCControlScene::init())
    {
        CCSize screenSize = CCDirector::sharedDirector()->getWinSize();
        
        CCNode *layer = CCNode::create();
        layer->setPosition(ccp (screenSize.width / 2, screenSize.height / 2));
        this->addChild(layer, 1);
        
        double layer_width = 0;
        
        // Add the black background for the text
        CCScale9Sprite *background  = CCScale9Sprite::create("extensions/buttonBackground.png");
        background->setContentSize(CCSizeMake(80, 50));
        background->setPosition(ccp(layer_width + background->getContentSize().width / 2.0f, 0));
        layer->addChild(background);
        
        layer_width += background->getContentSize().width;
        
        this->setDisplayValueLabel(CCLabelTTF::create("", "HelveticaNeue-Bold", 30));

        m_pDisplayValueLabel->setPosition(background->getPosition());
        layer->addChild(m_pDisplayValueLabel);
		
        // Add the slider
        CCControlPotentiometer *potentiometer = CCControlPotentiometer::create("extensions/potentiometerTrack.png"
                                                                                ,"extensions/potentiometerProgress.png"
                                                                                ,"extensions/potentiometerButton.png");
        potentiometer->setPosition(ccp (layer_width + 10 + potentiometer->getContentSize().width / 2, 0));

        // When the value of the slider will change, the given selector will be call
        potentiometer->addTargetWithActionForControlEvents(this, cccontrol_selector(CCControlPotentiometerTest::valueChanged), CCControlEventValueChanged);
        
		layer->addChild(potentiometer);
        
        layer_width += potentiometer->getContentSize().width;
        
        // Set the layer size
        layer->setContentSize(CCSizeMake(layer_width, 0));
        layer->setAnchorPoint(ccp (0.5f, 0.5f));
        
        // Update the value label
        this->valueChanged(potentiometer, CCControlEventValueChanged);
        return true;
	}
	return false;
}
Exemplo n.º 4
0
void SGEquipStrengLayer::initView()
{

    ResourceManager::sharedInstance()->bindTexture("sgequipslayer/sgequipslayer.plist", RES_TYPE_LAYER_UI, sg_equipstrengLayer);
    ResourceManager::sharedInstance()->bindTexture("animationFile/qhtexiao.plist", RES_TYPE_LAYER_UI, sg_equipstrengLayer);
    ResourceManager::sharedInstance()->bindTexture("animationFile/wjzs.plist", RES_TYPE_LAYER_UI, sg_equipstrengLayer);
    ResourceManager::sharedInstance()->bindTexture("sgpropslayer/sgpropslayer.plist", RES_TYPE_LAYER_UI, sg_equipstrengLayer);
    ResourceManager::sharedInstance()->bindTexture("sgvipinfolayer/sgvipinfolayer.plist", RES_TYPE_LAYER_UI, sg_equipstrengLayer); //提供横条图
    ResourceManager::sharedInstance()->bindTexture("sggeneralinfolayer/ofcNewUi.plist", RES_TYPE_LAYER_UI, sg_equipstrengLayer);

    SGNotificationCenter *notification = SGNotificationCenter::sharedNotificationCenter();
    notification->addObserver(MSG_EQUIP_NEWSTRENG,
                              this,
                              callfuncO_selector(SGEquipStrengLayer::equipStrenghListener));
    notification->addObserver(MSG_EQUIP_NEWAUTOSTRENG,
                              this,
                              callfuncO_selector(SGEquipStrengLayer::autoEquipStrenghListener));
	if (CCEGLView::sharedOpenGLView()->getFrameSize().width == ipadResource.size.width
        ||CCEGLView::sharedOpenGLView()->getFrameSize().width == ipadhdResource.size.width)
	{
		adpt_wid = -40;
		adpt_hei = -20;
		shift_ipad = 70;
	}
	else if (CCEGLView::sharedOpenGLView()->getFrameSize().height == iphonehdResource.size.height
             ||CCEGLView::sharedOpenGLView()->getFrameSize().height == iphoneResource.size.height)
	{
        adpt_wid = -10;
		adpt_hei = -50;
	}
    else
    {
        adpt_wid = -20;
		adpt_hei = -50;
    }
    
    CCSize winSize = CCDirector::sharedDirector()->getWinSize();
    float btmheight = SGMainManager::shareMain()->getBottomHeight();
    float frameheight1 = skewingY(81);
    float hgt=skewingY(233);
    menu->setZOrder(10);
    if (winSize.height == 1136)
    {
        frameheight1 = skewing(81);
        hgt = skewing(233);
    }
    
    //左火
    CCSpriterX *fermEffect = CCSpriterX::create("animationFile/qhhyA.scml", true, true);
    fermEffect->setanimaID(0);
    fermEffect->setisloop(true);
    addChild(fermEffect, 10, 0);
    //右火
    CCSpriterX *fermEffect1 = CCSpriterX::create("animationFile/qhhyB.scml", true, true);
    fermEffect1->setCCSpriterXFlipX(true);
    fermEffect1->setanimaID(0);
    fermEffect1->setisloop(true);
    addChild(fermEffect1, 10, 1);
    
	SGEquipmentDataModel *temp = SGStaticDataManager::shareStatic()->getEquipById(_card->getItemId());
	
    SGMainManager::shareMain()->addEquipPng(temp->getIconId(),sg_equipstrengLayer);
    CCString *str = CCString::createWithFormat("equip%d.png",temp->getIconId());
	
	
    CCSprite *item = CCSprite::createWithSpriteFrameName(str->getCString());
    this->addChild(item,2, 123);
    //创建4中颜色武将背景
    std::vector<std::string> str_vec;
    if(winSize.height != 1136)
    {
        str_vec.push_back("greenBg.png");
        str_vec.push_back("blueBg.png");
        str_vec.push_back("purpleBg.png");
        str_vec.push_back("orangeBg.png");
    }
    //inphone 5  根据武将地图来
    else
    {
        str_vec.push_back("greenBgI5.png");
        str_vec.push_back("blueBgI5.png");
        str_vec.push_back("purpleBgI5.png");
        str_vec.push_back("orangeBgI5.png");
    }
    int starLev = _card->getCurrStar();
    starLev = starLev<3?3:starLev;
    starLev = starLev>6?6:starLev;
    //光效背景图片
    CCSprite * lightBg = CCSprite::createWithSpriteFrameName(str_vec[starLev-3].c_str());
    this->addChild(lightBg , 0  , 1919);
    
    float adjustY = 0;
    CCSprite *bigbg = NULL;
    item->setAnchorPoint(ccp(0.5, 0));
    if (winSize.height == 960)
    {
        adjustY = 40;
        frameSize = CCRectMake(0, 0 , 768, 413);
        this->setItemID("pad装备底图.png",true);
        fermEffect->setScale(winSize.width/768);
        fermEffect1->setScale(winSize.width/768);
        fermEffect->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(-264, -287 +26)));
        fermEffect1->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(264, -287 +26)));
        item->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(0, -365)));
        
        lightBg->setZOrder(0);
        lightBg->setScaleX(winSize.width / lightBg->getContentSize().width);
        lightBg->setScaleY(1.6);
        lightBg->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter),
                               ccp(0, -title_bg->getContentSize().height - lightBg->getContentSize().height*0.5*lightBg->getScaleY())));;
        
    }
    else if (winSize.height == 1136)
    {
        adjustY=31;
        
        frameSize = CCRectMake(0, 520 -(winSize.height - hgt*1.18 - title_bg->getContentSize().height), 768, (winSize.height - hgt*1.18 - title_bg->getContentSize().height));
        this->setItemID("carditembg.png",true);
        fermEffect->setScaleX(winSize.width/768);
        fermEffect1->setScaleX(winSize.width/768);
        fermEffect->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(-264, -361+26)));
        fermEffect1->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(264, -361+26)));
        
        item->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(0, -450)));
        
        CCSprite *temp = CCSprite::createWithSpriteFrameName("carditembg.png");
        lightBg->setScaleX(winSize.width / lightBg->getContentSize().width);
        lightBg->setScaleY(temp->getContentSize().height * 0.75 / lightBg->getContentSize().height);
        lightBg->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter),
                               ccp(0, -title_bg->getContentSize().height - temp->getContentSize().height * 0.8 /2 + 16) ));
        
    }
    else
    {
        adjustY = 55;
        
        bigbg = CCSprite::createWithSpriteFrameName("pad装备底图.png");
        
        this->addChild(bigbg,-100);
        bigbg->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(0, - title_bg->getContentSize().height - bigbg->getContentSize().height*.45)));
        fermEffect->setPosition(ccpAdd(bigbg->getPosition(), ccp(-bigbg->getContentSize().width*.41, bigbg->getContentSize().height*.02 -bigbg->getContentSize().height*.098)));
        fermEffect1->setPosition(ccpAdd(bigbg->getPosition(), ccp(bigbg->getContentSize().width*.41, bigbg->getContentSize().height*.02-bigbg->getContentSize().height*.098)));
        
        item->setPosition(ccpAdd(bigbg->getPosition(), ccp(0, -bigbg->getContentSize().height*.362)));
        
        lightBg->setScaleX(winSize.width / lightBg->getContentSize().width);
        lightBg->setScaleY(1.9);
        lightBg->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter),
                               ccp(0, -title_bg->getContentSize().height-5 - lightBg->getContentSize().height*0.5*lightBg->getScaleY())));
    }
    equipItem = item;
    fermEffect->play();
    fermEffect1->play();
    
    this->setstar(_card->getCurrStar(),_card->getUpgradestar());
    this->setTitle(str_zhuangbeiqianghua);//_card->getOfficerName()->getCString()

    //////////////////////
    
    float btnwidth = skewing(5);
    float btnwid = skewing(33);
    
    equipStrengBtn = SGButton::createFromLocal(IMG_BTN_ON, str_qianghua_, this, menu_selector(SGEquipStrengLayer::equipStrengHandler),CCPointZero,FONT_PANGWA,ccWHITE,32,false,true);
    this->addBtn(equipStrengBtn);
    if(winSize.height==1136)
        equipStrengBtn->setPosition(ccp(winSize.width/2- btnwid*3 - btnwidth - adpt_wid, btmheight*.55 + equipStrengBtn->getContentSize().height*0.7+ adjustY*0.6));
    else if (winSize.height == 1024)
        equipStrengBtn->setPosition(ccp(winSize.width/2- btnwid*3 - btnwidth - adpt_wid, btmheight*.55 + equipStrengBtn->getContentSize().height*0.7));
    else
        equipStrengBtn->setPosition(ccp(winSize.width/2- btnwid*3 - btnwidth - adpt_wid, btmheight*.55 + equipStrengBtn->getContentSize().height*0.7 + 10));
    
    equipAutoStrengBtn = SGButton::createFromLocal(IMG_BTN_ON, str_autoqianghua, this, menu_selector(SGEquipStrengLayer::autoEquipStrengHandler),CCPointZero,FONT_PANGWA,ccWHITE,32,false,true);
    this->addBtn(equipAutoStrengBtn);
    equipAutoStrengBtn->setPosition(ccpAdd(equipStrengBtn->getPosition(), ccp( equipAutoStrengBtn->getContentSize().width - adpt_wid,0 )));
    
    int limittag = SGStaticDataManager::shareStatic()->getimitTagById(limitEquipGuide,9);
    equipAutoStrengBtn->setTag(limittag);
    
    SGButton *backBtn = SGButton::createFromLocal(IMG_BTN_ON, str_Back_, this, menu_selector(SGEquipStrengLayer::backHandler),CCPointZero,FONT_PANGWA,ccWHITE,32);
	backBtn->setScale(1.05);
    this->addBtn(backBtn);
    backBtn->setPosition(ccpAdd(equipAutoStrengBtn->getPosition(), ccp( backBtn->getContentSize().width - adpt_wid,0)));
    
    
    SGEquipmentDataModel *general = SGStaticDataManager::shareStatic()->getEquipById(_card->getItemId());
    this->setCardType(general->getEquipType());
    
 
    ////////////////////////
    
    float bigFrmWidth = winSize.width - 40;
    float bigFrmHeight = (int)winSize.height/3 -20;
    
    CCScale9Sprite *bigFrm = CCScale9Sprite::createWithSpriteFrameName("barrack_kuang.png");
    bigFrm->setPreferredSize(CCSizeMake(bigFrmWidth, bigFrmHeight));
    this->addChild(bigFrm,7);
    if(winSize.height==1136)
        bigFrm->setPosition(ccpAdd(ccp(winSize.width/2,equipStrengBtn->getPosition().y), ccp(0, equipStrengBtn->getContentSize().height/2 + bigFrmHeight/2 + 4 + adjustY*0.6)));
    else if(winSize.height==1024)
        bigFrm->setPosition(ccpAdd(ccp(winSize.width/2,equipStrengBtn->getPosition().y), ccp(0, equipStrengBtn->getContentSize().height/2 + bigFrmHeight/2 + 4)));
    else
        bigFrm->setPosition(ccpAdd(ccp(winSize.width/2,equipStrengBtn->getPosition().y), ccp(0, equipStrengBtn->getContentSize().height/2 + bigFrmHeight/2 + 10 )));
    
    CCSprite *bigFrmBg = CCSprite::createWithSpriteFrameName("barrack_kuangbg.png");
    this->addChild(bigFrmBg,6);
    bigFrmBg->setScaleX(bigFrmWidth/bigFrmBg->getContentSize().width);
    bigFrmBg->setScaleY(bigFrmHeight/bigFrmBg->getContentSize().height);
    bigFrmBg->setPosition(bigFrm->getPosition());
    
    CCSprite* admsBkg = CCSprite::createWithSpriteFrameName("store_redbg.png");
    float scaleX = winSize.width / admsBkg->getContentSize().height;
    float scaleY = 60 / admsBkg->getContentSize().height;
    admsBkg->setScaleX(scaleX);
    admsBkg->setScaleY(scaleY);
    this->addChild(admsBkg, 9);
//    admsBkg->setPosition(ccpAdd(bigFrm->getPosition(), ccp(0,admsBkg->getContentSize().height*scaleY/2 + bigFrm->getContentSize().height/2) ));
    
    admsBkg->setPosition(ccpAdd(lightBg->getPosition(), ccp(0, -lightBg->getScaleY() *lightBg->getContentSize().height*0.5 - admsBkg->getContentSize().height*0.5*lightBg->getScaleY() + adjustY)) );
    /////////////////////////////////
    
    equipName = SGCCLabelTTF::create(_card->getOfficerName()->getCString(), FONT_PANGWA, 26);
    equipName->setPosition(ccpAdd(bigFrm->getPosition(), ccp(-40,bigFrm->getContentSize().height/2 - 26 )));
    int equipStar = _card->getCurrStar() - 2;
    equipStar = equipStar < 0 ? 0 : equipStar;
    if (equipStar >= 0 && equipStar < 5) {
        equipName->setInsideColor(ccStarLevelColor[equipStar]);
    }
    else
    {
        equipName->setInsideColor(ccWHITE);
    }
    addChild(equipName,11);
    
    equiplevel = SGCCLabelTTF::create(CCString::createWithFormat("Lv %d/%d",_card->getCurrLevel(),SGPlayerInfo::sharePlayerInfo()->getPlayerLevel())->getCString(), FONT_PANGWA, 26);
    addChild(equiplevel,11);
    equiplevel->setPosition(ccpAdd(equipName->getPosition(), ccp(equipName->getContentSize().width/2 + equiplevel->getContentSize().width/2 + 20,0)));
    
    ///////////////////////////
    
    SGCCLabelTTF *costMoney = SGCCLabelTTF::create(str_zbqianghuancost, FONT_PANGWA, 24 , COLOR_UNKNOW_TAN);
    this->addChild(costMoney,11);
    costMoney->setPosition( ccp(costMoney->getContentSize().width/2 +20, admsBkg->getPosition().y));
    
    SGCCLabelTTF *totalMoney = SGCCLabelTTF::create(str_zbqianghuantotalMy, FONT_PANGWA, 24 , COLOR_UNKNOW_TAN);
    this->addChild(totalMoney,11);
    totalMoney->setPosition( ccp(winSize.width/2 + totalMoney->getContentSize().width/2 + 10 , costMoney->getPosition().y));
    
    CCSprite *font_bg = CCSprite::createWithSpriteFrameName(FONTBG);
    font_bg->setScaleY(1.4);
    this->addChild(font_bg,9);
    font_bg->setPosition(ccpAdd(costMoney->getPosition(),  ccp(costMoney->getContentSize().width/2 + font_bg->getContentSize().width/2+ 6,0)));
    
    font_bg = CCSprite::createWithSpriteFrameName(FONTBG);
    font_bg->setScaleY(1.4);
    this->addChild(font_bg,9);
    font_bg->setPosition(ccpAdd(totalMoney->getPosition(),  ccp(totalMoney->getContentSize().width/2 + font_bg->getContentSize().width/2+6,0)));
    
    CCSprite *coins = CCSprite::createWithSpriteFrameName("coinicon.png");
    coins->setPosition(ccpAdd(costMoney->getPosition(),ccp(costMoney->getContentSize().width/2 +coins->getContentSize().width/2+4,0)));
    addChild(coins,11);
    
    costCount = SGCCLabelTTF::create("999999", FONT_PANGWA, 24);
    costCount->setPosition(ccpAdd(coins->getPosition(),ccp(coins->getContentSize().width/2+costCount->getContentSize().width/2+8,0)));
    addChild(costCount,11);
    
    coins = CCSprite::createWithSpriteFrameName("coinicon.png");
    coins->setPosition(ccpAdd(totalMoney->getPosition(),ccp(totalMoney->getContentSize().width /2+coins->getContentSize().width/2+4,0)));
    addChild(coins,11);
    
    totalCount = SGCCLabelTTF::create("999999", FONT_PANGWA, 24);
    totalCount->setPosition(ccpAdd(coins->getPosition(),ccp(coins->getContentSize().width/2+totalCount->getContentSize().width/2 +8,0)));
    addChild(totalCount,11);
    
    /////////////////////////////////
    
    float f1Height = (int)bigFrmHeight*2/3;
    float f1Width = (int)f1Height* 0.85;
    
    CCScale9Sprite *frame1 = CCScale9Sprite::createWithSpriteFrameName(STATUSBG);
    frame1->setPreferredSize(CCSizeMake(f1Width, f1Height));
    this->addChild(frame1,11);
    frame1->setPosition(ccp(40 + f1Width/2, bigFrm->getPosition().y - 30));
    
    CCScale9Sprite *frame2 = CCScale9Sprite::createWithSpriteFrameName(STATUSBG);
    frame2->setPreferredSize(CCSizeMake(f1Width, f1Height));
    this->addChild(frame2,11);
    frame2->setPosition( ccp(winSize.width - frame1->getPosition().x, frame1->getPosition().y));
    
    
    SGCCLabelTTF *currentTitle = SGCCLabelTTF::create(str_zbqianghuacurstatus, FONT_PANGWA, 32);
    this->addChild(currentTitle,11);
    currentTitle->setPosition( ccp(frame1->getPosition().x, frame1->getPosition().y + frame1->getContentSize().height/2 + 30));

    SGCCLabelTTF *nextTitle = SGCCLabelTTF::create(str_zbqianghuanextstatus, FONT_PANGWA, 32 , ccGREEN);
    this->addChild(nextTitle,11);
    nextTitle->setPosition( ccp(frame2->getPosition().x, currentTitle->getPosition().y));
    //modify by:zyc. merge into create.
    //nextTitle->setColor(ccGREEN);
    
 
    CCSprite *equipArrow = CCSprite::createWithSpriteFrameName("equipArrow.png");
    this->addChild(equipArrow,20);
    equipArrow->setPosition(ccp(SGLayout::getPoint(kMiddleCenter).x, frame1->getPosition().y));

    this->addCurrStatus( ccpAdd(frame1->getPosition(),ccp( -f1Width/2,f1Height/2)),f1Width * 0.4,1.4*winSize.height/1140);
    this->addNextStatus( ccpAdd(frame2->getPosition(),ccp( -f1Width/2,f1Height/2)),f1Width * 0.4,1.4*winSize.height/1140);
    
    
    setEquipLevel(_card->getCurrLevel());
    setCostCount(_card->getCurrLevel());
    setCurrStatus(_card->getCurrLevel());

    creatBostLevel(SGLayout::getPoint(kMiddleCenter));
    
    showMainChat(false);
    
}
Exemplo n.º 5
0
void SGConsumableInfoLayer::initView()
{
	
    ResourceManager::sharedInstance()->bindTexture("animationFile/qhtexiao.plist",RES_TYPE_LAYER_UI ,sg_comsumableInfoLayer);
    ResourceManager::sharedInstance()->bindTexture("sgequipslayer/sgequipslayer.plist",RES_TYPE_LAYER_UI ,sg_comsumableInfoLayer);
    ResourceManager::sharedInstance()->bindTexture("sggeneralinfolayer/sggeneralinfolayer1.plist",RES_TYPE_LAYER_UI ,sg_comsumableInfoLayer);
    ResourceManager::sharedInstance()->bindTexture("sgrewardlayer/sgrewardlayer2.plist",RES_TYPE_LAYER_UI ,sg_comsumableInfoLayer);
    ResourceManager::sharedInstance()->bindTexture("sgsoldierslayer/sgsoldierslayer.plist",RES_TYPE_LAYER_UI ,sg_comsumableInfoLayer, LIM_PNG_AS_PNG);
    ResourceManager::sharedInstance()->bindTexture("sgpropslayer/sgpropslayer.plist",RES_TYPE_LAYER_UI ,sg_comsumableInfoLayer);
	
    
    CCSize s = CCDirector::sharedDirector()->getWinSize();
    float btmheight = SGMainManager::shareMain()->getBottomHeight();
	
    //float frameheight = skewingY(155);
    float hgt = skewingY(244);
    if (s.height == 1136) {
        //frameheight = skewing(155);
        hgt = skewing(244);
    }
    
	
    //左火
    CCSpriterX *fermEffect = CCSpriterX::create("animationFile/qhhyA.scml", true, true);
    
    fermEffect->setanimaID(0);
    fermEffect->setisloop(true);
    addChild(fermEffect, 10, 0);
    //右火
    CCSpriterX *fermEffect1 = CCSpriterX::create("animationFile/qhhyB.scml", true, true);
    fermEffect1->setCCSpriterXFlipX(true);
    fermEffect1->setanimaID(0);
    fermEffect1->setisloop(true);
    addChild(fermEffect1, 10, 1);
    CCLOG("type%d",_card->getItemType());
	//    if (_card->getType()) {
	//        statements
	//    }
    SGMainManager::shareMain()->addPropPng(_card->getHeadSuffixNum(),sg_comsumableInfoLayer);
    CCString *str = CCString::createWithFormat("prop%d.png",_card->getHeadSuffixNum());
    CCSprite *item = CCSprite::createWithSpriteFrameName(str->getCString());
    this->addChild(item,2);
    item->setAnchorPoint(ccp(0.5, 0));
	
    if (s.height == 960) {
        frameSize = CCRectMake(0, 0 , 768, 413);
        this->setItemID("pad装备底图.png",true);
        fermEffect->setScale(s.width/768);
        fermEffect1->setScale(s.width/768);
		
        fermEffect->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(-264, -287+26)));
        fermEffect1->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(264, -287+26)));
        item->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(0, -365)));
		
	}
    else if (s.height == 1136) {
        frameSize = CCRectMake(0, 520 -(s.height - hgt*1.13 - title_bg->getContentSize().height), 768, (s.height - hgt*1.13 - title_bg->getContentSize().height));
        this->setItemID("carditembg.png",true);
		
        fermEffect->setScaleX(s.width/768);
        fermEffect1->setScaleX(s.width/768);
        fermEffect->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(-264, -361+26)));
        fermEffect1->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(264, -361+26)));
		
        item->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(0, -450)));
		
		
    }else
    {
        CCSprite *a = CCSprite::createWithSpriteFrameName("pad装备底图.png");
        this->addChild(a,-100);
        a->setPosition(ccpAdd(SGLayout::getPoint(kUpCenter), ccp(0, - title_bg->getContentSize().height - a->getContentSize().height*.45)));
        fermEffect->setPosition(ccpAdd(a->getPosition(), ccp(-a->getContentSize().width*.41, a->getContentSize().height*.02 -a->getContentSize().height*.09)));
        fermEffect1->setPosition(ccpAdd(a->getPosition(), ccp(a->getContentSize().width*.41, a->getContentSize().height*.02-a->getContentSize().height*.09)));
        
        item->setPosition(ccpAdd(a->getPosition(), ccp(0, -a->getContentSize().height*.362)));
    }
    fermEffect->play();
    fermEffect1->play();
    menu->setZOrder(7);
	
    this->setstar(_card->getCurrStar());
    this->setTitle(_card->getOfficerName()->getCString());

	SGButton *backBtn = SGButton::createFromLocal("store_exchangebtnbg.png", str_back,
                                                  this, menu_selector(SGConsumableInfoLayer::backHandler),CCPointZero,FONT_PANGWA,ccWHITE,32);
	backBtn->setScale(1.05);
    this->addBtn(backBtn);
    backBtn->setPosition(ccpAdd(SGLayout::getPoint(kUpLeft), ccp( backBtn->getContentSize().width*.55, - backBtn->getContentSize().height*.55)));
    
    
    if(enterType == 101)
    {
        ResourceManager::sharedInstance()->bindTexture("sanguobigpic/barrack_bg.plist", RES_TYPE_LAYER_UI, sg_comsumableInfoLayer);

        CCSprite *bg1 = CCSprite::create("storyBg.png");
        //CCRect r = CCRectMake(0, 1136/2 - (hgt*1.13)/2, s.width, hgt*1.13);
        
        //bg1->setTextureRect(r);
        bg1->setScaleY(s.height/2 / bg1->getContentSize().height);
        bg1->setScaleX(s.width / bg1->getContentSize().width);
        bg1->setAnchorPoint(ccp(0.5, 0));
        bg1->setPosition(SGLayout::getPoint(kBottomCenter));
        this->addChild(bg1,5);
    }
    else
    {
		CCSprite *bg1 = CCSprite::createWithSpriteFrameName("info_redbg.png");
		bg1->setAnchorPoint(ccp(0.5, 0));
		bg1->setScaleX(s.width/bg1->getContentSize().width);
		bg1->setScaleY((hgt*1.13-btmheight*.68)/bg1->getContentSize().height);
		bg1->setPosition(ccpAdd(SGLayout::getPoint(kBottomCenter), ccp(0, btmheight*.68 )));
		this->addChild(bg1,5);
    }
    
    CCSprite* jinbian = CCSprite::createWithSpriteFrameName("jinbian.png");
    jinbian->setPosition(ccp(s.width/2, hgt*1.13));
    jinbian->setScaleX(s.width/jinbian->getContentSize().width);
    this->addChild(jinbian,6);
    
    CCScale9Sprite *frame2 = CCScale9Sprite::createWithSpriteFrameName("barrack_kuang.png");
    frame2->setPreferredSize(CCSizeMake(568+20, 320));
    this->addChild(frame2,7);
    frame2->setPosition(ccpAdd(jinbian->getPosition(), ccp(0, -frame2->getContentSize().height/2 - 30)));
	
    CCSprite *frame2bg = CCSprite::createWithSpriteFrameName("barrack_kuangbg.png");
    this->addChild(frame2bg,6);
    frame2bg->setScaleX(590/frame2bg->getContentSize().width);
    frame2bg->setScaleY(320/frame2bg->getContentSize().height);
    frame2bg->setPosition(frame2->getPosition());
    
    CCSprite *guang2l = CCSprite::createWithSpriteFrameName("barrack_kuang_guangl.png");
    this->addChild(guang2l,6);
    guang2l->setAnchorPoint(ccp(0, 1));
    CCSprite *guang2r = CCSprite::createWithSpriteFrameName("barrack_kuang_guangl.png");
    this->addChild(guang2r,6);
    guang2r->setFlipX(true);
    guang2r->setAnchorPoint(ccp(1, 1));
    
    CCSprite *guang2m = CCSprite::createWithSpriteFrameName("barrack_kuang_guangm.png");
    this->addChild(guang2m,6);
    guang2m->setScaleX(468/guang2m->getContentSize().width);
    guang2m->setAnchorPoint(ccp(0.5, 1));
    
    guang2m->setPosition(ccpAdd(frame2->getPosition(), ccp(0, frame2->getContentSize().height*.5)));
    guang2r->setPosition(ccpAdd(guang2m->getPosition(), ccp(284+10, 0)));
    guang2l->setPosition(ccpAdd(guang2m->getPosition(), ccp(-284-10, 0)));
    
    CCScale9Sprite *fontbg = CCScale9Sprite::createWithSpriteFrameName("box_fontbg.png");
    fontbg->setPreferredSize(CCSizeMake(538, 205));
    this->addChild(fontbg,6);
    fontbg->setPosition(ccpAdd(frame2->getPosition(), ccp(0, 26)));

    
    SGConsumableDataModel *temp = SGStaticDataManager::shareStatic()->getConsumableById(_card->getItemId());
    SGCCLabelTTF* a = SGCCLabelTTF::create(temp->getConsumeDesc()->getCString(), FONT_BOXINFO, 28, CCSizeMake(504,400));
    a->setAnchorPoint(ccp(0.5f, 1));
    this->addChild(a,6);
	a->setPosition(ccpAdd(fontbg->getPosition(), ccp(0, fontbg->getContentSize().height*.33)));
	
	//setCardType,“强化合成“
	SGConsumableDataModel *consumeData = SGStaticDataManager::shareStatic()->getConsumableById(_card->getItemId());
    this->setCardType(consumeData->getConsumeType());
	
}