예제 #1
0
void TetrisGameLayer::startGame(){
    
    G_current_HandleType = new LongBlock_Type();
    G_current_HandleType->init();
    
    CCSize size = CCDirector::sharedDirector()->getWinSize();
    //控制按钮//
    CCMenuItemImage * left = CCMenuItemImage::create("left.png", "left.png");
    left->setTarget(this, menu_selector(TetrisGameLayer::leftButtonPressed));
    left->setScale(0.5);
    CCMenuItemImage * right = CCMenuItemImage::create("right.png", "right.png");
    right->setTarget(this, menu_selector(TetrisGameLayer::rightButtonPressed));
    left->setAnchorPoint(ccp(0, 0));
    right->setAnchorPoint(ccp(0, 0));
    right->setScale(0.5);
    right->setPosition(ccp(size.width/2+size.width/4, 0));
    
    CCMenuItemImage * down = CCMenuItemImage::create("down.png", "down.png");
    down->setTarget(this, menu_selector(TetrisGameLayer::downButtonPressed));
    down->setAnchorPoint(ccp(0,0));
    down->setScale(0.5);
    down->setPosition(ccp(size.width/2 -100,0));
    down->setOpacity(0.7*255);
    
    CCMenu * menu = CCMenu::create(left,down,right, NULL);
    menu->setAnchorPoint(ccp(0, 0));
    menu->setPosition(ccp(0, 0));
    this->addChild(menu);
}
예제 #2
0
void ConsoleCocos2dxLayer::onConsoleButtonClick(CCObject* pSender)
{
	CCMenuItemImage* consoleButton = static_cast<CCMenuItemImage*>(pSender);
	if (consoleButton->getOpacity() > 128) // seems in console mode
	{
		consoleButton->setOpacity(128);
		// remove console view
		removeChild(m_consoleView);
	}
	else // seems not in console mode
	{
		consoleButton->setOpacity(255);
		// add console view
		addChild(m_consoleView);
	}
}
예제 #3
0
void MainHeaderLayer::setContent(BaseSprite* header)
{
	if (mHeader)
	{
		mHeader->removeFromParentAndCleanup(true);
	}

	mHeader = header;

	// 没有头部,就添加默认的头部
	if (mHeader == NULL)
		mHeader = createDefaultHead();

	if (mHeader)
	{
		addChild(mHeader);
		CCPoint originPos = CCDirector::sharedDirector()->getVisibleOrigin();
		CCSize visbleSize = CCDirector::sharedDirector()->getVisibleSize();
		mHeader->setPosition(ccp(mWinSize.width/2,originPos.y +visbleSize.height - mHeader->getContentSize().height/2));

		//防止头部下边的按钮被点中!!  (装备列表)
		CCMenuItemImage *headItem = CCMenuItemImage::create(mHeader->getFileName().c_str(), mHeader->getFileName().c_str(), mHeader->getFileName().c_str());
		headItem->setOpacity(0);
		headItem->setPosition(mHeader->getPosition());
		CCMenu *menu = CCMenu::create(headItem, NULL);
//		addChild(menu);
		menu->setPosition(CCPointZero);
	}
}
예제 #4
0
void ZhuangbeiXilianUI::clickXilianJingHua(CCObject *obj)
{
	if (m_dInfoDialog)
	{
		m_dInfoDialog->removeFromParent();
		m_dInfoDialog = NULL;
	}
	string tishiStr = LFStrings::getValue("XilianJingHuaShuoMing");
	string cailiaoFileStr = "daoju_youlanzhiye.png";

	//弹框背景
	BaseSprite* dialog = BaseSprite::create("gongjiang_duanzao_cailiaobuzu_tanchukuang.png");
	dialog->setPosition(ccp(mWinSize.width/2, mWinSize.height/2 + 50));
	//提示
	{
		BaseSprite *cailiaoBg = BaseSprite::create("daoju_kuang_bg.png");
		dialog->addChild(cailiaoBg);
		cailiaoBg->setPosition(ccp(cailiaoBg->getContentSize().width/2 + 10, dialog->getContentSize().height/2));
		BaseSprite *cailiaoImg = BaseSprite::create(cailiaoFileStr);
		cailiaoBg->addChild(cailiaoImg);
		cailiaoImg->setPosition(ccp(cailiaoBg->getContentSize().width/2, cailiaoBg->getContentSize().height/2));

		CCLabelTTF* lable = CCLabelTTF::create(tishiStr.c_str(), fontStr_kaiti,20,CCSize(240, 0), kCCTextAlignmentLeft);
		dialog->addChild(lable);
		lable->setAnchorPoint(ccp(0,0.5));
		lable->setPosition(ccp(cailiaoBg->getPositionX()+cailiaoBg->getContentSize().width/2 , dialog->getContentSize().height/2));
	}
	//按键
	CCMenu* menu = CCMenu::create();
	{
		CCMenuItemImage* item = CCMenuItemImage::create(
			"gongjiang_duanzao_cailiaobuzu_tanchukuang.png",
			"gongjiang_duanzao_cailiaobuzu_tanchukuang.png",
			this, menu_selector(ZhuangbeiXilianUI::clickCiaoliaoShuoMing));
		menu->addChild(item);
		item->setPosition(ccp(dialog->getContentSize().width/2, dialog->getContentSize().height/2));
		item->setOpacity(0);
		item->setScaleX(mWinSize.width / dialog->getContentSize().width);
		item->setScaleY(mWinSize.height / dialog->getContentSize().height);
		// 		item->setScaleX(mWinSize.width / item->getContentSize().width);
		// 		item->setScaleY(mWinSize.height / item->getContentSize().height);
	}
	//弹框
	{

		LFAlert* lfAlert = new LFAlert();
		lfAlert->setBaseContainer(dialog,menu);
		CCDirector::sharedDirector()->getRunningScene()->addChild(lfAlert,128);
		lfAlert->release();
		m_dInfoDialog = lfAlert;
	}
}
예제 #5
0
CCMenuItemImage* Objects2dFactory::clickableRectangle(CCNode* scene, CCMenu* menu, ccColor3B color, float positionX, float positionY, float width, float height, 
	SEL_MenuHandler selector, void* selectorArg, AlignX alignX, AlignY alignY, GLubyte opacity, int zOrder)
{
	// Check arguments validity
	if(scene == NULL || menu == NULL || !selector)
		return NULL;

	// Create a button menu item
    CCMenuItemImage *button = CCMenuItemImage::create("TopQXResources/white.png", "TopQXResources/white.png", "TopQXResources/white.png", scene, selector);
    if(!button)
		return NULL;

	// Set argument
	if (selectorArg != NULL)
	{
		button->setUserData(selectorArg);
	}
	
	// Set color
	button->setColor(color);

	// Set opacity
	button->setOpacity(opacity);

    // Place the menu item in the given position
    button->setPosition(ccp(positionX, positionY));

	// Set anchor
	button->setAnchorPoint(ccp(Constants::getAnchorValue(alignX), Constants::getAnchorValue(alignY)));
	
	// Set menu item width
	float buttonWidth = button->boundingBox().size.width;
    button->setScaleX(width / buttonWidth);

	// Set menu item height
	float buttonHeight = button->boundingBox().size.height;
	button->setScaleY(height / buttonHeight);
    
	// Add button to the menu
	menu->addChild(button, zOrder);
	
	return button;
}
예제 #6
0
void HelloWorld::selectBlock(CCObject* target)
{
	// enable pillars
	for (int i=0 ; i<3 ; i++)
	{
		((CCMenuItemImage*)((this->getChildByTag(i))->getChildByTag(i)))->setEnabled(true);
	}

	// set all block colors to default
	for (int x=3 ; x<10 ; x++)
	{
		((CCMenuItemImage*)((this->getChildByTag(x))->getChildByTag(x)))->setOpacity(255);
	}

	// set selected block color
	CCMenuItemImage* block = (CCMenuItemImage*)(target);
	selectedBlock = block->getTag();
	block->setOpacity(140);
	//CCLog("selectedBlock is %i",selectedBlock);
}
예제 #7
0
bool ConsoleCocos2dxLayer::init()
{
	if (CCLayer::init())
	{
		// first we create console view
		m_consoleView = ConsoleViewCocos2dx::create();
		if (!m_consoleView) return false;
		m_consoleView->retain();

		// then create console controller
		m_consoleController = new ConsoleControllerBase();
		if (!m_consoleController->Init())
		{
			CC_SAFE_DELETE(m_consoleController);
			return false;
		}

		// bind view to controller
		m_consoleController->SetView(m_consoleView);

		// then we create console menu
		CCSize visualSize = CCDirector::sharedDirector()->getVisibleSize();

		CCMenuItemImage* consoleButton = CCMenuItemImage::create("Console/Terminal.png", "Console/Terminal.png", this, menu_selector(ConsoleCocos2dxLayer::onConsoleButtonClick));
		if (!consoleButton) return false;
		consoleButton->setScale(0.45f);
		consoleButton->setOpacity(128);
		consoleButton->setPosition(ccp(visualSize.width * 0.05f, visualSize.height * 0.88f));

		CCMenu* consoleMenu = CCMenu::create(consoleButton, NULL);
		consoleMenu->setPosition(ccp(0, 0));
		consoleMenu->setTouchPriority(kCCMenuHandlerPriority - 2); // NOTE: pay attention to this
		addChild(consoleMenu, 1); // NOTE: should at top

		// at last, we init cvars and ccmds
		// and that's it :)
		return initCVarAndCCmd();
	}
	
	return false;
}
예제 #8
0
// on "init" you need to initialize your instance
bool ControlLayer::init()
{

    // add a menu item with "X" image, which is clicked to quit the program
    // you may modify it.

    // add a "close" icon to exit the progress. it's an autorelease object

    CCSize winSize = CCDirector::sharedDirector()->getWinSize();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create("CloseNormal.png", "CloseSelected.png",
                                        this,
                                        menu_selector(ControlLayer::menuCloseCallback) );
    pCloseItem->setPosition( ccp(winSize.width-20, 20) );
    pCloseItem->setScale(0.5);
    pCloseItem->setOpacity(200);

    // create menu, it's an autorelease object
    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition( CCPointZero );
    this->addChild(pMenu, 1);

    CCMenuItemImage *upItem = CCMenuItemImage::create("button.png", "selected.png", this, menu_selector(ControlLayer::Moveup));
    CCMenuItemImage *downItem = CCMenuItemImage::create("button.png", "selected.png", this, menu_selector(ControlLayer::Movedown));
    CCMenuItemImage *rightItem = CCMenuItemImage::create("button.png", "selected.png", this, menu_selector(ControlLayer::Moveright));
    CCMenuItemImage *leftItem = CCMenuItemImage::create("button.png", "selected.png", this, menu_selector(ControlLayer::Moveleft));

    int bX; //the x coordination
    int bY; //the y coordination

    int sizeAdjustionRatioConstant = 3;    // for the auto adjusting size
    float bScale = winSize.height / (sizeAdjustionRatioConstant * 100); // (screenHeight / buttonHeight) * ratioConstant
    int transparence = 30;

    bX = (winSize.width / 2);
    bY = (winSize.height / 6) * 5;
    upItem->setPosition( ccp(bX, bY) );
    upItem->setOpacity(transparence);
    upItem->setScale(bScale);


    bX = (winSize.width / 2);
    bY = (winSize.height / 6) * 1;
    downItem->setPosition( ccp(bX, bY) );
    downItem->setOpacity(transparence);
    downItem->setRotation(180);
    downItem->setScale(bScale);

    bX = (winSize.width / 6) * 5;
    bY = (winSize.height / 2);
    rightItem->setPosition( ccp(bX, bY) );
    rightItem->setOpacity(transparence);
    rightItem->setRotation(90);
    rightItem->setScale(bScale);

    bX = (winSize.width / 6) * 1;
    bY = (winSize.height / 2);
    leftItem->setPosition( ccp(bX, bY) );
    leftItem->setOpacity(transparence);
    leftItem->setRotation(270);
    leftItem->setScale(bScale);


    CCMenu* moveItem = CCMenu::create(upItem, downItem, rightItem, leftItem, NULL);
    moveItem->setPosition( CCPointZero );
    this->addChild(moveItem, 0);


    return true;
}
예제 #9
0
bool S65ShowVideo::setUpSubClass2()
{
	bool bRet = false;
	do
	{
        scrollMaxSizeY = 0;
        
        CCLayer *pLayer = CCLayer::create();
        pLayer->setPosition(CCPointZero);
        
        m_pScrollView = CCScrollView::create();
        m_pScrollView->setPosition(ScriptParser::getPositionFromPlist(plistDic, "scrollView"));
        m_pScrollView->setContainer(pLayer);
        
        CCSize showSize = ScriptParser::getSizeFromPlist(plistDic, "showSize");
        
        m_pScrollView->setViewSize(CCSizeMake(showSize.width, showSize.height-20));
        
        string str1 = "S"+PersonalApi::convertIntToString(AppDelegate::S1NaviSelected) +"5scrollPic";
        string str2 = "S"+PersonalApi::convertIntToString(AppDelegate::S1NaviSelected) +"5VideoIntro";
        string str3 = "S"+PersonalApi::convertIntToString(AppDelegate::S1NaviSelected) +"5ScrollBigPic";
        
        showStrUrlMap = PersonalApi::getRealGroupStringMap(plistDic,str2.c_str(),"videoIntro");
        showPicMap = PersonalApi::getRealGroupImageMap(plistDic,str1.c_str(),"scrollPic");
        showBigPicMap = PersonalApi::getRealGroupImageMap(plistDic,str3.c_str(),"scrollBigPic");
        
        int indexNum = 1;
        
        float elementWidth;
        float elementHeight;
        int mapSize = showPicMap.size();
        int mapSizeRemainder = mapSize%4;
        int mapSizeAver;
        
        if (mapSizeRemainder>0) {
            mapSizeAver = mapSize/4+1;
        }else{
            mapSizeAver = mapSize/4;
        }
        
        
        {
            const char *imageName = showPicMap[PersonalApi::convertfloatToString(indexNum)].c_str();
            string str = PersonalApi::getRealImageName(imageName, "S15Small_1.png").c_str();
            CCMenuItemImage * aItemImage = CCMenuItemImage::create(str.c_str(),
                                                                   str.c_str(),
                                                                   this,
                                                                   menu_selector(S65ShowVideo::S15DetailCallback));
            
            elementWidth = aItemImage->getContentSize().width+31;
            elementHeight = aItemImage->getContentSize().height+20;
            
            scrollMaxSizeY = elementHeight*mapSizeAver;
            
            
        }
        
        
        for (int i  = 0; i<(int)showPicMap.size()/4+1; i++){
            if (4*(i+1)<=mapSize) {
                for (int j = 0; j<4; j++)
                {
                    const char * imageName = showPicMap[PersonalApi::convertIntToString(indexNum)].c_str();
                    
                    string  str=PersonalApi::getRealImageName(imageName,"S15Small_1.png").c_str();
                    CCLOG("aaaaa%s",str.c_str());
                    
                    CCMenuItemImage * aItemImage = CCMenuItemImage::create(str.c_str(),
                                                                           str.c_str(),
                                                                           this,
                                                                           menu_selector(S65ShowVideo::S15DetailCallback));
                    aItemImage->setPosition(ccp(3+145+(aItemImage->getContentSize().width+31)*j,scrollMaxSizeY-elementHeight/2-elementHeight*i));//showSize.height-elementHeight*1.5+(aItemImage->getContentSize().height+20)*i)
                    
                    FDMenu * detailMenu = FDMenu::create();
                    detailMenu ->setPosition(CCPointZero);
                    detailMenu->addChild(aItemImage,zNum);
                    pLayer->addChild(detailMenu,zNum);
                    
                    aItemImage->setTag(btnTag+indexNum);
                    if (i==0&&j<2)
                    {
                        aItemImage->setOpacity(1);
                    }
                    indexNum++;
                }
            }else{
                for (int j = 0; j<mapSizeRemainder; j++)
                {
                    CCLog("pppppp");
                    const char * imageName = showPicMap[PersonalApi::convertIntToString(indexNum)].c_str();
                    
                    string  str=PersonalApi::getRealImageName(imageName,"S15Small_1.png").c_str();
//                    CCLOG("aaaaa%s",str.c_str());
                    
                    CCMenuItemImage * aItemImage = CCMenuItemImage::create(str.c_str(),
                                                                           str.c_str(),
                                                                           this,
                                                                           menu_selector(S65ShowVideo::S15DetailCallback));
                    aItemImage->setPosition(ccp(3+145+(aItemImage->getContentSize().width+31)*j,scrollMaxSizeY-elementHeight/2-elementHeight*(i)));//scrollMaxSizeY-elementHeight/2+elementHeight*i)   scrollMaxSizeY-elementHeight/2-elementHeight*(mapSizeAver-i-1)
                    FDMenu * detailMenu = FDMenu::create();
                    detailMenu ->setPosition(CCPointZero);
                    detailMenu->addChild(aItemImage,zNum);
                    pLayer->addChild(detailMenu,zNum);
                    
                    aItemImage->setTag(btnTag+indexNum);
                    
                    indexNum++;
                }
            }
            
            
            if(i==0){
                const char * imageName = "S45ScrollBigPic1.png";//showBigPicMap[PersonalApi::convertIntToString(i+1)].c_str();
                
                string  str=PersonalApi::getRealImageName(imageName,"S15Big_1.png").c_str();
                
                CCMenuItemImage * aItemImage = CCMenuItemImage::create(str.c_str(),
                                                                       str.c_str(),
                                                                       this,
                                                                       menu_selector(S65ShowVideo::S15DetailCallback));
                aItemImage->setAnchorPoint(CCPointZero);
                aItemImage->setPosition(ccp(36,2+scrollMaxSizeY-elementHeight*2+elementHeight*i));
                if (1 == (int)showPicMap.size()/4+1)
                {
                    aItemImage->setPosition(ccp(36,-(aItemImage->getContentSize().height-30)-2+scrollMaxSizeY-elementHeight*2+elementHeight*i));
                }
                
                FDMenu * detailMenu = FDMenu::create();
                detailMenu ->setPosition(CCPointZero);
                detailMenu->addChild(aItemImage,zNum);
                pLayer->addChild(detailMenu,zNum+1);
                
                aItemImage->setTag(btnTag+indexNum-3);
            }
            
        }
        
        
        
        m_pScrollView->setTouchEnabled(true);
        
        pLayer->setContentSize(CCSizeMake(showSize.width, scrollMaxSizeY));
        m_pScrollView->setContentOffset(ccp(0,-(scrollMaxSizeY-showSize.height)));
        m_pScrollView->setDirection(kCCScrollViewDirectionVertical);
        m_pScrollView->setDelegate(this);
        this->addChild(m_pScrollView);
        
        
		bRet = true;
	} while (0);
    
	return bRet;
}
예제 #10
0
bool OverMenu::init(CCNode* layer_)
{
    if(!CCLayer::init()){
        return false;
    }
    layer=layer_;

    layer->addChild(this,50);
    this->schedule(schedule_selector(OverMenu::tick));

    
    int score=((GameLayer*)layer)->gamebody->score;
    if(((GameLayer*)layer)->gamebody->game_mode==MODE_SHUANGZI){
        score=((GameLayer*)layer)->gamebody->score+((GameLayer*)layer)->gamebody2->score;
    }
    
    bool ishigh=false;
    
    int modeid=CCUserDefault::sharedUserDefault()->getIntegerForKey("gamemode");
    char modehighscore[200];
    sprintf(modehighscore, "highscore%d",modeid);
    int highscore=CCUserDefault::sharedUserDefault()->getIntegerForKey(modehighscore);
    if(score>highscore){
        highscore=score;
        CCUserDefault::sharedUserDefault()->setIntegerForKey(modehighscore, highscore);
        CCUserDefault::sharedUserDefault()->flush();
        ishigh=true;
        CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("sound/newscore.mp3", false);
    }
    
    
    
    
    {
        CCMenuItemImage *button = CCMenuItemImage::create(
                                                          "game/black.jpg",
                                                          "game/black.jpg",
                                                          this,
                                                          NULL );
        CCMenu* Menu = CCMenu::create(button, NULL);
        Menu->setPosition(CCPointZero);
        this->addChild(Menu,-1);
        button->setAnchorPoint(ccp(0.5f,0));
        button->setPosition(ccp(screenSize.width*0.5f,0));
        button->setOpacity(150);
    }
    
    
    {
        pane=CCSprite::create("over/back.png");
        this->addChild(pane,1);
        pane->setScale(0.3f*screenSize.height/pane->getContentSize().height);
        pane->setPosition(ccpPercent(50, 155));
        
        {
            CCMoveTo* a1=CCMoveTo::create(0.4f, ccpPercent(50, 60));
            pane->runAction(a1);
        }
        
        {
            CCLabelTTF* word = CCLabelTTF::create("游戏结束", "ttf/word.ttf", pane->getContentSize().height*0.2f);
            word->setAnchorPoint(ccp(0.5f,0.5f));
            pane->addChild(word, 10);
            word->setPosition(ccpContent(pane->getContentSize(), 50, 120));
            word->setColor(ccGRAY);
        }
        
        {
            char* name;
            GAME_MODE gamemode=((GameLayer*)layer)->game_mode;
            char* gamecenterid;
            if(gamemode==MODE_WANMEI){
                name=(char*)"完美模式";
                gamecenterid=(char*)"com.adultdream.mengmengda.wanmei";
            }
            if(gamemode==MODE_SHANDIAN){
                name=(char*)"闪电模式";
                gamecenterid=(char*)"com.adultdream.mengmengda.shandian";
            }
            if(gamemode==MODE_NIUZHUAN){
                name=(char*)"扭转模式";
                gamecenterid=(char*)"com.adultdream.mengmengda.niuzhuan";
            }
            if(gamemode==MODE_SHUANGZI){
                name=(char*)"双子模式";
                gamecenterid=(char*)"com.adultdream.mengmengda.shuangzi";
            }
            if(gamemode==MODE_XIANSHI){
                name=(char*)"限时模式";
                gamecenterid=(char*)"com.adultdream.mengmengda.xianshi";
            }
            if(gamemode==MODE_JINGDIAN){
                name=(char*)"经典模式";
                gamecenterid=(char*)"com.adultdream.mengmengda.jingdian";
            }
            
            CCLabelTTF* word = CCLabelTTF::create(name, "ttf/word.ttf", pane->getContentSize().height*0.15f);
            word->setAnchorPoint(ccp(0.5f,0.5f));
            pane->addChild(word, 10);
            word->setPosition(ccpContent(pane->getContentSize(), 50, 80));
            word->setColor(ccc3(255, 0, 255));
            
            
            if(ishigh==true){
            }
        }
        
        
        
        {
            char number[200];
            sprintf(number, "%d", score);
            
            CCLabelTTF* word = CCLabelTTF::create(number, "ttf/word.ttf", pane->getContentSize().height*0.2f);
            word->setAnchorPoint(ccp(0.5f,0.5f));
            pane->addChild(word, 10);
            word->setPosition(ccpContent(pane->getContentSize(), 50, 50));
            word->setColor(ccBLACK);
            
            if(ishigh==true){
                CCLabelTTF* hword = CCLabelTTF::create("(新记录!)", "ttf/word.ttf", pane->getContentSize().height*0.1f);
                hword->setAnchorPoint(ccp(0.5f,0.5f));
                pane->addChild(hword, 10);
                hword->setPosition(ccpContent(pane->getContentSize(), 50, 40));
                hword->setColor(ccRED);
                
                word->setPosition(ccpContent(pane->getContentSize(), 50, 60));
            }
        }
        
        {
            char text[200];
            sprintf(text, "最佳:%d", highscore);
            
            CCLabelTTF* word = CCLabelTTF::create(text, "ttf/word.ttf", pane->getContentSize().height*0.1f);
            word->setAnchorPoint(ccp(0.5f,0.5f));
            pane->addChild(word, 10);
            word->setPosition(ccpContent(pane->getContentSize(), 50, 20));
            word->setColor(ccBLACK);
        }
        
        {
            CCMenuItemImage *button = CCMenuItemImage::create(
                                                              "over/replay.png",
                                                              "over/replay.png",
                                                              layer,
                                                              menu_selector(GameLayer::replaceScene) );
            CCMenu* Menu = CCMenu::create(button, NULL);
            Menu->setPosition(CCPointZero);
            pane->addChild(Menu,1);
            button->setScale(0.3f*pane->getContentSize().height/button->getContentSize().height);
            button->setPosition(ccpContent(pane->getContentSize(), 90, -80));
            
            {
                button->setOpacity(0);
                CCDelayTime* d=CCDelayTime::create(0.5f);
                CCFadeTo* a1=CCFadeTo::create(0.5f, 255);
                CCSequence* l=(CCSequence*)CCSequence::create(d,a1,NULL);
                button->runAction(l);
            }
        }
        
        {
            CCMenuItemImage *button = CCMenuItemImage::create(
                                                              "over/home.png",
                                                              "over/home.png",
                                                              layer,
                                                              menu_selector(OverMenu::back_menu) );
            CCMenu* Menu = CCMenu::create(button, NULL);
            Menu->setPosition(CCPointZero);
            pane->addChild(Menu,1);
            button->setScale(0.3f*pane->getContentSize().height/button->getContentSize().height);
            button->setPosition(ccpContent(pane->getContentSize(), 10, -80));
            
            {
                button->setOpacity(0);
                CCDelayTime* d=CCDelayTime::create(0.5f);
                CCFadeTo* a1=CCFadeTo::create(0.5f, 255);
                CCSequence* l=(CCSequence*)CCSequence::create(d,a1,NULL);
                button->runAction(l);
            }
        }
        
//        {
//            CCMenuItemImage *button = CCMenuItemImage::create(
//                                                              "over/gamecenter.png",
//                                                              "over/gamecenter.png",
//                                                              layer,
//                                                              menu_selector(OverMenu::game_center) );
//            CCMenu* Menu = CCMenu::create(button, NULL);
//            Menu->setPosition(CCPointZero);
//            pane->addChild(Menu,1);
//            button->setScale(0.3f*pane->getContentSize().height/button->getContentSize().height);
//            button->setPosition(ccpContent(pane->getContentSize(), 50, -80));
//            
//            {
//                button->setOpacity(0);
//                CCDelayTime* d=CCDelayTime::create(0.5f);
//                CCFadeTo* a1=CCFadeTo::create(0.5f, 255);
//                CCSequence* l=(CCSequence*)CCSequence::create(d,a1,NULL);
//                button->runAction(l);
//            }
//        }
        
//        {
//            CCMenuItemImage *button = CCMenuItemImage::create(
//                                                              "over/weixin.png",
//                                                              "over/weixin.png",
//                                                              layer,
//                                                              menu_selector(OverMenu::share_weixin) );
//            CCMenu* Menu = CCMenu::create(button, NULL);
//            Menu->setPosition(CCPointZero);
//            pane->addChild(Menu,1);
//            button->setScale(0.25f*pane->getContentSize().height/button->getContentSize().height);
//            button->setPosition(ccpContent(pane->getContentSize(), 85, -30));
//            
//            {
//                button->setOpacity(0);
//                CCDelayTime* d=CCDelayTime::create(0.5f);
//                CCFadeTo* a1=CCFadeTo::create(0.5f, 255);
//                CCSequence* l=(CCSequence*)CCSequence::create(d,a1,NULL);
//                button->runAction(l);
//            }
//            
//            int check=BBGetOnlineParam((char*)"weixin", (char*)"0");
//            if(check==0){
//                button->setVisible(false);
//            }
//        }
        
//        {
//            CCMenuItemImage *button = CCMenuItemImage::create(
//                                                              "over/friend.png",
//                                                              "over/friend.png",
//                                                              layer,
//                                                              menu_selector(OverMenu::share_friend) );
//            CCMenu* Menu = CCMenu::create(button, NULL);
//            Menu->setPosition(CCPointZero);
//            pane->addChild(Menu,1);
//            button->setScale(0.25f*pane->getContentSize().height/button->getContentSize().height);
//            button->setPosition(ccpContent(pane->getContentSize(),15, -30));
//            
//            {
//                button->setOpacity(0);
//                CCDelayTime* d=CCDelayTime::create(0.5f);
//                CCFadeTo* a1=CCFadeTo::create(0.5f, 255);
//                CCSequence* l=(CCSequence*)CCSequence::create(d,a1,NULL);
//                button->runAction(l);
//            }
//            
//            int check=BBGetOnlineParam((char*)"weixin", (char*)"0");
//            if(check==0){
//                button->setVisible(false);
//            }
//        }
    }
    
    
//    {
//        float umeng_delay=BBGetOnlineParam((char*)"FullScreenDelay", (char*)"1");
//        CCDelayTime* d=CCDelayTime::create(umeng_delay);
//        CCCallFunc * f=CCCallFunc::create(this, callfunc_selector(OverMenu::show_full_ad));
//        CCSequence* l=(CCSequence*)CCSequence::create(d,f,NULL);
//        runAction(l);
//    }
    
    HLAdManagerWrapper::showUnsafeInterstitial();
    
    return true;
}