示例#1
0
bool ClassicScene::init()
{
    do
    {
        CC_BREAK_IF(!BaseScene::init());
     //   SimpleAudioEngine::sharedEngine()->playBackgroundMusic("sounds/BGM/Play_bgm_long.mp3",true);
        initBg();
        return true;
    }
    while (0);
    return false;
}
bool OrganSelectEntity::init()
{
    bool bRet=false;
    do
    {
        if (!Layer::init())
        {
            break;
        }
        
        initBg();
        initKantai();
        
        bRet=true;
    }while(0);
    
    
    return bRet;
}
bool KantaiDestroyEntity::init()
{
    bool bRet=false;
    do
    {
        if (!Layer::init())
        {
            break;
        }
        
        initBg();
        initKantai();
        
        bRet=true;
    }while(0);
    
    
    return bRet;
}
示例#4
0
bool UIBuyBuildingLayer::init()
{
	bool bRef = false;
	do{
		CC_BREAK_IF(!LayerColor::initWithColor(Color4B(25, 25, 25, 125)));
		
		auto listener = EventListenerTouchOneByOne::create();
		listener->setSwallowTouches(true);
		listener->onTouchBegan = CC_CALLBACK_2(UIBuyBuildingLayer::onTouchesBegan,this);
		listener->onTouchMoved = CC_CALLBACK_2(UIBuyBuildingLayer::onTouchesMoved,this);
		listener->onTouchEnded = CC_CALLBACK_2(UIBuyBuildingLayer::onTouchesEnded,this);
		listener->onTouchCancelled = CC_CALLBACK_2(UIBuyBuildingLayer::onTouchCancelled,this);
		_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);

		initBg();

		bRef = true;
	}while(0);
	return bRef;
}
示例#5
0
文件: GameScene.cpp 项目: yw920/dota
bool GameScene::init()
{
    if (!Layer::init())
	{
        
		return false;
	}
    
    initBg();
    
    initUI();
    
    initHeros();
    
    addTouchListener();
   
	
    scheduleUpdate();
    
	return true;
}
bool ListEntity::init()
{
    bool bRet=false;
    do
    {
        
        if (!Layer::init())
        {
            break;
        }
        
        

        initBg();
        initSortButton();
        initRows();
        initPageSwitch();
        addChild(menu);
        updateRows();
        
        bRet=true;
    }while(0);
    return bRet;
}
示例#7
0
void GameBgLayer::initSprite(){
     initBg();
    initClound();
    initMid1Bg();
    initMid2Bg();
}